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

How do i make specific players spawn with specific weapons?

i have some guns thats for my friends but i dont know how to make only them spawn with the guns, the only way i can do right now is using admin

2 answers

This isn't a request site but whatever.

local Whitelist = {"",""} -- People that will spawn with weapons.
local Weapons = {game.ServerStorage["Glock 19"],game.ServerStorage["Glock 21"]} -- Put the location of the guns here.
game.Players.PlayerAdded:Connect(function(Player)
	for i,v in pairs(Whitelist) do
		if v == Player.Name then
			for i,v in pairs(Weapons) do
				local A = v:Clone()
				A.Parent = Player.Backpack
			end	
		else
		end
	end
	local C = workspace:WaitForChild(Player.Name)
	if C.ClassName == "Model" then return true end
	C.Humanoid.Died:Connect(function()
		Player:LoadCharacter()
		wait(.5)
		for i,v in pairs(Whitelist) do
			if v == Player.Name then
				for i,v in pairs(Weapons) do
					local A = v:Clone()
					A.Parent = Player.Backpack
				end	
			else
			end
		end
	end)
end)

7 comments

0

so where do i insert the script?

0

I think you would insert the script in ServerScriptService

0

i tried but it doesnt work

0

Make sure you replace the values required or of course it won't work.

0

Make sure you replace the values required or of course it won't work.

0

can u like help me or something?

0

I dont think you need to add in the else on line 10

so idk where to insert the script is it serverscript stuff or where

1 comment

0

why would you put your edit as an entire answer... this site needs a tutorial

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