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

How to give a "weapon" when spawned?

When the character spawns in the game I tried to give them a weapon. Here is the script that some reason DIDN'T error, but it won't work properly.

function Security(plr)

if plr:IsInGroup(1056046) and plr:GetRankInGroup(1056046) == 38 or 255 then

	local Sw = game.ServerStorage.LinkedSword:Clone()

local HoldIT = plr:WaitForChild(game.Players.localPlayer.Backpack)

	wait(HoldIT)

Sw.Parent = plr.Backpack
	
	print("Sword Was Given")
else
	print("Sword Wasn't Given")
end

end

	game.Players.PlayerAdded:connect(Security)

Sorry if you can't read it.

How do I get it so whenever they spawn into the game they'll get a weapon called LinkedSword

Comment for questions! Thanks for the help!!

3 answers

✓ Accepted answer

Maybe it's because you're trying to use HoldIT inside of wait(). I thought wait() only took integers as arguments

1 comment

0

Well, you were sorta right. It was the "HoldIT" variable itself. Thanks for trying.

We'll, a much easier way would to be just put the 'LinkedSword' item itself inside of the folder called 'StarterPack'

3 comments

0

Hope that helped! If so please thumbs up!

0

Eh, I'm not doing that for a "reason" I don't want to give a sword to everyone....

0

He's trying to make it so only the people in his group gets a sword.

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