Script doesn't work in my game,but it works in others

I don’t understand, i made a cooldown script for my car,since the gui bugs when u get in the car and jump out instantly, but it works only in other games not in the one i want,the script is inside cars seat. Heres the script:

local Cooldown = script.Parent

--cheks for humanoid
local function onTouch(otherPart)
	--stores parent parameters parent object smth
	local character = otherPart.Parent
	print("seat has been touched")
	--look for the humanoid
	local humanoid = character:FindFirstChildWhichIsA("Humanoid")
	if humanoid then
		humanoid.JumpPower = 0
		wait(2)
		humanoid.JumpPower = 50
	end

end
--touch even connection
Cooldown.Touched:Connect(onTouch)
1 Like

This ?
More like:

local Cooldown = script.Parent

--cheks for humanoid
local function onTouch(otherPart)
--stores parent parameters parent object smth
local character = otherPart.Parent
print("seat has been touched")
--look for the humanoid
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.JumpPower = 0
wait(2)
humanoid.JumpPower = 50
end

end
--touch even connection
Cooldown.Touched:Connect(onTouch)

This LOL.

1 Like

??? I don’t understand. lul

1 Like

He means that you should put code in a code block, it makes it easier to interpret.

Use the </> icon on the top for it

2 Likes