this is what I have so far on switching it. It isnt working and Im not sure why, do any of you guys see if Im making any mistakes in transferring?
local msg = script.Parent.NoticeTycoon:Clone()
function onTouched(part)
local player = game.Players.LocalPlayer
local teamColor = script.Parent.Parent.Parent.teamColor
if(player.TeamColor==BrickColor.new(teamColor.Value)) then
local stats = player:findFirstChild("leaderstats")
if (stats~=nil) then
local score = stats:findFirstChild("Resources")
local cash = stats:findFirstChild("Cash")
if (score~=nil and score.Value~=0) then
script.Parent.showGUI.Value = true
script.Parent.resourceVa.Value = score.Value
cash.Value = cash.Value + (score.Value / 10)
script.Parent.Parent.Parent.Resources.Value = script.Parent.Parent.Parent.Resources.Value + score.Value
score.Value = 0
end
end
end
end
script.Parent.Touched:connect(onTouched)
|