Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why am i getting an output on giving tools to players?

I put this script in the sever script and it did work .Not sure why it said in the output "globalgivePlayersTools"

function givePlayersTools() --"Fist" is the tool
    local copy = game.SeverStorage.Fist:Clone()
    copy.Parent = game.Players.LocalPlayers.Character
end
givePlayersTools()

1 answer

function givePlayersTools() --"Fist" is the tool
    local copy = game.SeverStorage.Fist:Clone()
    copy.Parent = game.Players.LocalPlayers.Character
end
givePlayersTools()

You can't access 'game.Players.LocalPlayer' from a Server-Sided Script, only in a Local Script.

Here is a better solution, giving the tool to all players:

function givePlayersTools() --"Fist" is the tool
	for i,v in pairs(game.Players:GetChildren()) do
  		local copy = game.SeverStorage.Fist:Clone()
		copy.Parent = v.Backpack
	end
end
givePlayersTools()

This discussion is preserved as it was. New answers, comments, and votes are closed.