Hello, I'm A Beginner In Scripting And I'm Making A Simulator Game And I'm Making A Script And I Don't Know How To Add A Cooldown In Here So Could Anyone Do It?
local Players = game:GetService("Players")
local sword = game.ReplicatedFirst.ClassicSword
local part = script.Parent
local function onTouched(part)
local player = Players:GetPlayerFromCharacter(part.Parent)
if not player then return end
local backpack = player.Backpack
sword:Clone().Parent = backpack
end
part.Touched:Connect(onTouched)

11 comments
It did'nt Work
what was the output?
The out put Is " Workspace.Part.Sword Giver:8: Expected 'then' when parsing if statement, got 'cooldown' "
Lightning just forgot to add "then" to his if statement.
yeeaahhh.. i will fix that
now it should work
now it should work
now it should work
now it should work
now it should work
now it should work