Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to give a "weapon" when spawned?

Asked by
tanzane 100
9 years ago

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

Log in to vote
1
Answered by 9 years ago

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

0
Well, you were sorta right. It was the "HoldIT" variable itself. Thanks for trying. tanzane 100 — 9y
Ad
Log in to vote
0
Answered by
woodengop 1134 Moderation Voter
9 years ago

Try learning it from Here

Log in to vote
-3
Answered by 9 years ago

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

0
Hope that helped! If so please thumbs up! yogipanda123 120 — 9y
0
Eh, I'm not doing that for a "reason" I don't want to give a sword to everyone.... tanzane 100 — 9y
0
He's trying to make it so only the people in his group gets a sword. Discern 1007 — 9y

Answer this question