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

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

Asked by 4 years ago

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)

0
You should at least attempt it, this is scripting HELPERS after all. CaptainAlien132 225 — 4y
0
Maybe just do a PlayerAdded event and clone a hat and put it in the player's character. ChristianTRPOC 64 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
I will try this, thank you. EricStoynov1749 -5 — 4y
0
Hmmmm it does not work... EricStoynov1749 -5 — 4y
0
I updated the script. PrismaticFruits 842 — 4y
0
Also make sure your team colors are really blue and really red. PrismaticFruits 842 — 4y
View all comments (4 more)
0
Hmm, I did everything and used your new code and it still does not work. EricStoynov1749 -5 — 4y
0
Do you have discord, I would like to talk to you as I am more active on discord, TH3PR0P13X#3220. EricStoynov1749 -5 — 4y
0
I am sorry but I don't have discord. PrismaticFruits 842 — 4y
0
I have updated the code again. PrismaticFruits 842 — 4y
Ad

Answer this question