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

The weapon is seen in the studio but not in Roblox Player?

Asked by 5 years ago

I have a script that what it does is that when the player enters a Team I give him a tool (weapon), but my problem is not the script. My problem is that when trying the weapon it looks good in the studio but when I try it in the Roblox Player does not load the weapon. That is, if he gives me the weapon but does not load the weapon (Do not see). Is it because I have it in a Folder in ReplicatedStorage?

0
You're assuming every player that joins your game is a male. User#19524 175 — 5y
0
I'm sorry I wanted to say that the script gives me the weapon when I enter the Team but it does not load me the Weapon (it is not seen) xmaanzach 28 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Put this in ServerScriptStorage:

local teams = game:GetService("Teams")
local weaponteam = --The team you want to give the weapon to.
local storage = game:GetService("ReplicatedStorage") --In-case it's in ReplicatedStorage
local weapon = --Locate the tool instance here.

local function GiveWeapon(plr)
    weapon:Clone().Parent = plr.Backpack --Lmao direct script cuz im lazy af
end)

game.Players.PlayerAdded:connect(function(plr)
    plr:GetPropertyChangedSignal("Team"):Connect(function()
        if plr.Team = weaponteam then
            GiveWeapon(plr)
        end
    end)
end)

@incapaz pls dont hurt me for spoon feeding.

Ad

Answer this question