I'm trying to make a script so that when the game owner enters the game, they are given a unique tool located in ReplicatedStorage. I'm no expert on scripting, but I know some of the basics. I've been trying to come up with a script, but nothing works. This is what I already have:
game.Players.PlayerAdded:connect(function(check)
if check:FindFirstChild("Humanoid") then
if check.Name == "Player" then
local player = game.Players:GetPlayerFromCharacter(check)
if player ~= nil then
local tool = game.ReplicatedStorage.TOOLNAME:Clone()
tool.Parent = player.Backpack
end
end
end
end)
I've also tried this, but still I got nothing.
tool1 = game.ReplicatedStorage.Owner.Guided
game.Players.PlayerAdded:connect(function(ownercheck)
if (ownercheck.Name == "Player"~= nil) then
game.Workspace:WaitForChild("Player")
local owner = game.Workspace.Player
local tool1Clone = tool1:Clone()
owner:WaitForChild("Backpack")
tool1Clone.Parent = owner.Backpack
end
end)
