Basically changing torso color

local number = game.StarterPlayer
local player = game.Players.LocalPlayer
local char = player.Character
local torso = char.UpperTorso


if number.Value < 1 then
	number.Value = 1
elseif number.Value > 3 then
	number.Value = 3	
end

script.Parent.MouseButton1Click:connect(function()
	if number.Value < 3 then 
		number.Value = number.Value+1
	elseif number.Value == 3 then
		number.Value = number.Value-2
	end
	if number.Value == 1 then
		torso.Color = Color3.new(255,0,0)
		print("Okay 1")
	elseif number.Value == 2 then
		torso.Color = Color3.new(255,255,0)
		print("Okay 2")
	elseif number.Value == 3 then
		torso.Color = Color3.new(0,0,255)
		print("Okay 3")
	end
end)

It no work Not printing any of Okay's

6 comments

0

um, StarterPlayer isn't a int value, it is an object

0

also, color3.new() has to have values between 0 and 1, use color3.fromRGB if you want to use numbers 0-255

2

starter player isn't a number and also you should be using body colors, not changing the torso color directly because unless the material is anything other than SmoothPlastic, it won't change the color

0

^What they said above, but furthermore you should do player.Character or player.CharacterAdded:Wait() as well as a WaitForChild("UpperTorso") because they may not exist at the creation of the script

0

What's number.value? You probably have to specify number.value clearer, and do show us the console errors (if there's any) too.

0

It says UpperTorso isn't a valid member of Model