As I’m making a game right now, I’m wondering how can I give myself a tool just for me. Like when a creator of a game has joined, they might get like an OP weapon that nobody else has but only the creator. How can I achieve something like this?
Use a player .added event, Check if the player.userid is yours, then Give you such item.
1 Like
you can use this all you need to do is change the “[Path to tool]” to a path to well your tool.
game.Players.PlayerAdded:Connect(function(player)
if player.UserId == game.CreatorId then
[Path to tool]:Clone().Parent = player.Backpack
end
end)
1 Like
local tool = [Path to tool] -- path here, i.e game:GetService("ServerStorage").OPTOOL
game.Players.PlayerAdded:Connect(function(player)
if player.UserId == game.CreatorId then
tool:Clone().Parent = player.StarterGear
tool:Clone().Parent = player.Backpack
end
end)
Edited your code so that they receive it every time they respawn too.
4 Likes
Why don’t you use CharacterAdded event?
Placing the tool in StarterGear means that it will be placed in their backpack on respawn. It’s much cleaner than using a CharacterAdded event.
1 Like