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

How would I do these things? Also in need of some serious scripting help.

I am extremely new at roblox lua and find it very hard to learn as I need someone to teach me, I am a hands on learner who cannot comprehend via videos or reading.

Here's what I have so far...

game.Workspace.ChildAdded:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
	playerinplayers.CanLoadCharacterAppearance = false
	plr.Head.face.Texture = "rbxassetid://"
	local bodycolors = Instance.new("BodyColors", plr)
	bodycolors.RightArmColor = BrickColor.new("Pastel brown")
	bodycolors.LeftArmColor = BrickColor.new("Pastel brown")
	bodycolors.RightLegColor = BrickColor.new("Pastel brown")
	bodycolors.LeftLegColor = BrickColor.new("Pastel brown")
	bodycolors.TorsoColor = BrickColor.new("")
	bodycolors.HeadColor = BrickColor.new("Pastel brown")
end	
	
	
	
	
	
	
	
end)

Basically, I am trying to make the characters spawn in with a torso color of their corresponding team color.

I found a script online but cannot figure out how to do this.

I am also trying to figure out how to have it so players spawn in with a tool that is in lighting without using the kohls admin command for give. Placing the item into the starter inventory does not work alone.

3 comments

0

could you please edit the question and when typing the script: look at the buttons at the time, you'll see a B and other symbols. click the blue on, and put all the script between in the space between the ~~~~~~~

0

also for the spawning with tool. drag the tool into starterpack. for using it with scripts, do local NAME = game.Lighting.NAME:Clone(); NAME.Parent = game.Players.LocalPlayer.Backpack;

0

Sorry, I didn't understand what you meant. Also, putting the tool into starter pack does NOT work.

2 answers

I've edited Acheo's answer. This should work.

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if char:FindFirstChild("Torso") ~= nil then
char.Torso.BrickColor = BrickColor.new(plr.TeamColor)
end
end)
end)

`

4 comments

0

Still doesn't work, even being fixed.

0

Strange, heres a list of things that you should look out for when scripting in ROBLOX: Is your script disabled? Is there another error in the script? If they don't work send me the output when you test this script.

0

that's the thing, none are disabled... just the torso is always green

0

Hmm. Can you give m your output?

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if char:FindFirstChild("Torso") ~= nil then
char.Torso.BrickColor = BrickColor.new(plr.TeamColor)
end
end)
end)

5 comments

0

I can't figure out how to get that to work... or how to even integrate it into what I already have, sorry for my stupidity.

0

Just create a script and paste this code into the script.

0

Didn't work, red teams torso just turned green..

0

Wow, someone downvoted me. Do you want it to CONSTANTLY change colors with the torso or just when the player spawns?

0

I think it was the person who copy pasted your answer..... I basically just want people to spawn with the torso color of their corresponding team every time they spawn.

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