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

String Value wont change in script. No error?

Self explanatory.

local str = "Programmer"
game:GetService("Players").PlayerAdded:Connect(function(plr)
     if plr.TeamColor == BrickColor.New("Lapis") then
	 	plr.leaderstats.Job.Value = str
else
	print("Hi")
     end
end)

1 comment

0

Does "Hi" print? Is this a server or a local script?

3 answers

Idk why it isnt working. Maybe try this method

local str = "Programmer"
local Team = game:GetService("Teams"):WaitForChild("Your-Team-Name") --put here ur team name

game:GetService("Players").PlayerAdded:Connect(function(plr)
	if plr.Team == Team then
		plr.leaderstats.Job.Value = str
	else
		print("Hi")
	end
end)

I always use this method(maybe it working more properly)

3 comments

0

Doesent work.

0

You should explain why your method works and his doesn't instead of "copy paste this man it'll work"

0

I said "(maybe it working more properly)". idk what method is better

check if the script is disabled, and make sure you set the teamcolor exactly the same value as lapis

I think the problem is that you do NOT set the TeamColor for the player...

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