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

How To Give Weapons To all Players?

So I have All Code Ready, The Teleport and everything works, I want to Do When They Teleport, They Get A Gun, Which in my case is a RPG, Please Help Thanks!

2 comments

0

Do you want all players that join the game or all players in the game at one specific time?

0

At One Specified time

2 answers

If you want all players to get a gun when they teleport, all you would need to do is clone the RPG from storage into the player's backpack just after they teleport.

Here's an example of how to do that: (this is unusable until you change the hierarchy to match yours)

local rpg = RPG:Clone()
rpg.Parent = player

If this answers your question, then mark it as the accepted answer.

2 comments

0

You are parenting the cloned rpg to the player not the backpack of the player.

0

Assuming 'player' is the player instance.

local replicatedstorage = game:GetService("ReplicatedStorage")
local tool = replicatedstorage:WaitForChild("Gun") -- change "Gun" to the weapons name
local cangive = false
game.Players.PlayerAdded:Connect(function(player)
	if cangive then
		tool:Clone().Parent = player:WaitForChild("Backpack")
		tool:Clone().Parent = player:WaitForChild("StarterGear") -- they spawn with it
	end
end)
	

make a statement in your script where it turns 'cangive' to true

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