Hi, new to scripting I was following a tutorial on how to make a bounce pad, I have no clue how to de bug local scripts. I can’t get the bounce pads to work…
The bounce pads are tagged using the tag editor plugin, also there is nothing in the output, nothing is underlined blue in the script which is why I am confused.
I don’t have any experience using the tag editor plugin, but I think you could just go through all of the parts with the tag, and if they are touched apply a force to the humanoidrootpart?
print("This should run")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")
local localPlayer = game.Players.LocalPlayer
local boing = ReplicatedStorage:WaitForChild("BOING")
local JUMP_FORCE = 1500
local SPRING_LENGTH = 5
for _, pad in pairs (CollectionService:GetTagged("BouncePad")) do
print(pad)
local bottom = pad:WaitForChild("bottom")
local spring = bottom:WaitForChild("SpringConstraint")
local hitbox = pad:WaitForChild("Hitbox")
pad:SetAttribute("isTouched",false)
hitbox.Touched:Connect(function(otherPart)
print("Touched")
local humanoid = otherPart.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid and not pad:GetAttribute("isTouched") and otherPart.Parent.Name == localPlayer.Name then
print("Found someone that didn't touch the bouncy bouncy")
pad:SetAttribute("isTouched",true)
otherPart:ApplyImpulse(Vector3.new(0,JUMP_FORCE,0))
boing:Play()
spring.FreeLength = SPRING_LENGTH
wait(0.5)
spring.FreeLength = 0.1
pad:SetAttribute("isTouched",false)
end
end)
end