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

How do i make specific players spawn with specific weapons?

Asked by
kaarefoxy -10
3 years ago

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

Log in to vote
0
Answered by 3 years ago

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)
0
so where do i insert the script? kaarefoxy -10 — 3y
0
I think you would insert the script in ServerScriptService Oxprem 140 — 3y
0
i tried but it doesnt work kaarefoxy -10 — 3y
0
Make sure you replace the values required or of course it won't work. DetectiveRaie 193 — 3y
View all comments (3 more)
0
Make sure you replace the values required or of course it won't work. DetectiveRaie 193 — 3y
0
can u like help me or something? kaarefoxy -10 — 3y
0
I dont think you need to add in the else on line 10 kingtasaz123 6 — 3y
Ad
Log in to vote
-1
Answered by
kaarefoxy -10
3 years ago

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

0
why would you put your edit as an entire answer... this site needs a tutorial speedyfox66 237 — 3y

Answer this question