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

String question for value?

Asked by 9 years ago

Ok, so when a player joins there is a new intvalue created in lighting under a model named blocks. The intvalue is named the players team name. This script is supposed to award 1 point if the block is not their team color, but if it is their team color it wont award. The problem is, I want to make it short but in line 6 it says that "colors" is an invalid member of model, please help!

function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) ye = game.lighting.blocks

local colors = player.TeamColor script.Parent.brickColor = player.TeamColor if script.Parent.brickColor == player.TeamColor then game.lighting.blocks.colors.Value = game.lighting.blocks.colors.Value +0 elseif script.Parent.brickColor ~= player.TeamColor then game.lighting.blocks.colors.Value = game.lighting.blocks.colors.Value +1 end end

script.Parent.Touched:connect(onTouched)

2
Please edit your post and use the Lua code formatter so that your post is readable. BlueTaslem 18071 — 9y

Answer this question