#How can I learn to write good forumulas
1 messages · Page 1 of 1 (latest)
take inspiration from other games
No like formulas in scripting
For progression
? dont understand
Ive been asking ai for forever
well that's probably your first problem
e = mc^2
True
Like scaling expirence needed to level up?
Kinda like that. Im doing a speed system where it visually every step adds 10 speed but behind the scenes it’s different
It has a curve slowly doing less and less using exponents
It’s just I can’t write them on my own. Im struggling now because I need a way for speed to be claimed by rewards (+100 speed) but then have that scaled to the amount of actual speed you would get if you walked until 100 speed
Yk
I'm not really sure what you're on about
I'll say what i'm understanding and you tell me if i'm correct
You don't check the amount of steps the player does, So instead, while they are moving you have a value that increases slowly and exponentially increases (as they will be walking faster)
Yea the more they walk the less speed they gain. It’s a +1 speed per second escape game if you’ve seen those
The thing is I have 2 separate values. The visual speed and the actual speed. The visual speed goes up by a base of 10 while the actual speed slows down the more speed you have.
So idk how I could write a formula where if I claimed 100 visual speed it would add speed based on how much speed you already have
math
local coins = 100
local Multiplier = coins / 20 -- change it if u want
local CoinsAdded = 5 * Multiplier
while task.wait(1) do
coins += CoinsAdded
Multiplier = coins / 20
end
oh wait i forgot something
ok now fixed
i hope
got me stressing
local RunService = game:GetService("RunService")
local coins = 100
local lastUpdate = os.clock() -- or tick()
local conn
conn = RunService.Heartbeat:Connect(function()
local now = os.clock() -- or tick()
if now - lastUpdate >= 1 then
coins += coins * 0.25
lastUpdate = now
end
end)```
?
why are using os.clock()