#im VERY NEW at scripting WHY DOESNT MY JUMPPAD WORK
1 messages · Page 1 of 1 (latest)
every if must be paired with then and end
your if cooldownthingy == true ... end doesnt have a 'then'. it should be if cooldownthingy == true then ... end
also i would recommend making onTouched a local so local function onTouched()
and then an even bigger issue: your onTouched() function is inside an if statement. this means that script.Parent.Touched:Connect(onTouched) can't access onTouched
also, :connect() is deprecated. you should use :Connect() instead
also something seems to be wrong with Jumppad.Velocity, but I can't pinpoint it, so I'll ignore it for now
just now that that is a problem
improved script:
jumppad.Velocity = Vector3.new(0,0,0)
cooldownthingy = true
local function onTouched(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
if cooldownthingy == true then
cooldownthingy = false
jumppad.Velocity = Vector3.new(0,550,0)
humanoid.WalkSpeed *= 6
task.wait(2)
humanoid.WalkSpeed /= 6
jumppad.Velocity = Vector3.new(0,0,0)
task.wait(8)
cooldownthingy = true
end
end
end
script.Parent.Touched:Connect(onTouched)```
even then, jumppad.Velocity has a problem u will need to figure out, but above is the basically modern version and corrected version of your script
still u did really good as a beginner. good job 😄
other changes I made:
:findFirstChild() --> :FindFirstChild()
wait() --> task.wait()
hum.WalkSpeed = hum.WalkSpeed * 6 --> hum.WalkSpeed *= 6 (does the same thing, but simplified.)
:connect() --> :Connect()
these are basically just modern corrections but good job!!
@gleaming pivot i already fixed it but you have taught me a thing or two. thank you a lot!
i wonder fucking why
chill out bro i realized my mistakes and fixed them 😭 i just started 2 days ago
I DID i fixed it read my messages i sent after
nah it's peak
That's just preference