Well, that didn't work I'll show you my scripts:
WELDING:
local Tool = script.Parent;
Enabled = true
function onActivated()
if not Enabled then
return
end
Enabled = false
wait(1)
script.Parent.Handle.EatingSound:Play()
wait(2)
local h = Tool.Parent:FindFirstChild("Humanoid")
if (h ~= nil) then
if (h.MaxHealth > h.Health + 10) then
h.Health = h.Health + 10
else
h.Health = h.MaxHealth
end
end
wait(1)
script.Parent:remove()
end
function onEquipped()
script.Parent.Handle.OpenSound:play()
script.Parent:remove()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
SPEED BOOST:
local Tool = script.Parent
local db = false
script.Parent.Activated:Connect(function()
local h = Tool.Parent:FindFirstChild("Humanoid")
if db == false then
db = true
h.WalkSpeed = 50
wait(10)
h.WalkSpeed = 16
db = false
end
end)
GUI:
Enabled = true
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if not Enabled then
return
end
Enabled = false
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()
wait(5)
script.Parent:Destroy()
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)
1 comment
Have you tried using a local function instead of anonymous functions?