of     1   

Raildex
#182950644Wednesday, February 03, 2016 10:31 PM GMT

local msg = script.Parent.NoticeTycoon:Clone() function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if (h~=nil) then local teamColor = script.Parent.Parent.Parent.teamColor if game.Players:playerFromCharacter(h.Parent).TeamColor==BrickColor.new(teamColor.Value)then local thisplr = game.Players:findFirstChild(h.Parent.Name) if (thisplr~=nil) then local stats = thisplr: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 end end script.Parent.Touched:connect(onTouched)
BothAngles
#182951362Wednesday, February 03, 2016 10:44 PM GMT

Yes :)
Raildex
#182951499Wednesday, February 03, 2016 10:47 PM GMT

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)
Wrathsong
#182952045Wednesday, February 03, 2016 10:58 PM GMT

"script.Parent.Touched:connect(onTouched)" If you're using a Touched function inside a brick, you need a server script (normal script) since localscripts can only be used in certain places. http://wiki.roblox.com/index.php?title=API:Class/LocalScript

    of     1