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

On player join, If red hat, give hat and vest, If blue team give different hat and vest?

https://i.imgur.com/8xxUxiA.png

How would I do this?

(I am not begging for the source code, If you want to you can but I am not begging for it)

2 comments

0

You should at least attempt it, this is scripting HELPERS after all.

0

Maybe just do a PlayerAdded event and clone a hat and put it in the player's character.

1 answer

Make sure you have a morph of the Red Team and the Blue Team in ReplicatedFirst and rename the blue one to BlueMorph and the red to RedMorph. Then insert this code into a local script in ServerScriptService.

local redMorph = game.ReplicatedFirst.RedMorph
local blueMorph = game.ReplicatedFirst.BlueMorph

game.Players.PlayerAdded:Connect(function(plr)
       local char = plr.Parent
       local hum = char:FindFirstChildWhichIsA("Humanoid")
       local player = game.Players.LocalPlayer
       if player.TeamColor == "Really red" then
              local red = redMorph:Clone()
              red.Parent = game.StarterPlayer
              red.Name = "StarterCharacter"
              hum:LoadCharacter()
       end
       if player.TeamColor == "Really blue" then
              local blue = blueMorph:Clone()
              blue.Parent = game.StarterPlayer
              blue.Name = "StarterCharacter"
              hum:LoadCharacter()
       end
end)

Be aware this may not work as I am fairly new to scripting, but at least try it (also the indentation may not be correct so you may want to type it out yourself).

If this helped in any way please accept this answer.

8 comments

0

I will try this, thank you.

0

Hmmmm it does not work...

0

I updated the script.

0

Also make sure your team colors are really blue and really red.

0

Hmm, I did everything and used your new code and it still does not work.

0

Do you have discord, I would like to talk to you as I am more active on discord, TH3PR0P13X#3220.

0

I am sorry but I don't have discord.

0

I have updated the code again.

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