|
| 17 Dec 2015 02:48 PM |
Not too sure where I'm going wrong, trying to make a multi point terminal. I have three capture points with a script like this in it, inside the brick itself is also a BoolValue that should be changed when someone touches it
local Owner
script.Parent.Touched:connect(function(hit) Player = game.Players:GetPlayerFromCharacter(hit.Parent) if Player ~= nil then if hit.Parent.Humanoid.Health <= 0 then return end Owner = Player.TeamColor end end)
if Owner == BrickColor.new("Bright yellow") then script.Parent.PointA.Value = true elseif Owner == BrickColor.new("Bright red") then script.Parent.PointA.Value = false end
Then elsewhere there's a script that determines how many BoolValues are at what value.
local TermA = script.Parent.HillA.PointA local TermB = script.Parent.HillB.PointB local TermC = script.Parent.HillC.PointC
local score1 = 0
if TermA == false and TermB == false and TermC == false then Score1 = 0 if TermA == false and TermB == false and TermC == true or TermA == false and TermB == true and TermC == false or TermA == true and TermB == false and TermC == false then score1 = score1-1 end
if TermA == false and TermB == true and TermC == true or TermA == true and TermB == true and TermC == false or TermA == true and TermB == false and TermC == true then score1 = score1+1 end if TermA == true and TermB == true and TermC == true then score1 = score1+3 end end
I know it's REALLY basic, but I'm still learning. The main problem I'm having is that the boolValue does not change when the brick is touched, it might just be a problem of me trying to store it in a BoolValue but I'd like a bit of help/advice. |
|
|
| Report Abuse |
|
|
| 17 Dec 2015 02:52 PM |
| The owner variable is incomplete. |
|
|
| Report Abuse |
|