I have a script that is supposed to give a tool to owner but it just prints that the owner is the owner but never gives the owner the actual tools
local Pass = "Miserable_Haven"
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(hit)
player:WaitForChild("Backpack")
if player.Name == Pass then
local cln = game.ServerStorage:WaitForChild("Throttle"):Clone(player.Backpack)
if player.Backpack:FindFirstChild(cln) then
print(player.Name.." has been given "..cln.Name)
end
local cln = game.ServerStorage:WaitForChild("DisableController"):Clone(player.Backpack)
if player.Backpack:FindFirstChild(cln) then
print(player.Name.." has been given "..cln.Name)
end
print(player.Name.." is "..Pass)
else
print(player.Name.." is not "..Pass)
end
end)
end)
i tried this before and it didnt work but now I try it again it somehow works
new code :
local Pass = "Miserable_Haven"
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(hit)
player:WaitForChild("Backpack")
if player.Name == Pass then
local cln = game.ServerStorage:WaitForChild("Throttle"):Clone()
cln.Parent = player.Backpack
if player.Backpack:FindFirstChild(cln) then
print(player.Name.." has been given "..cln.Name)
end
local cln = game.ServerStorage:WaitForChild("DisableController"):Clone()
cln.Parent = player.Backpack
if player.Backpack:FindFirstChild(cln) then
print(player.Name.." has been given "..cln.Name)
end
print(player.Name.." is "..Pass)
else
print(player.Name.." is not "..Pass)
end
end)
end)