|
| 18 Mar 2013 02:22 PM |
when this script runs it runs more than once each time the button is pressed...
when the button is touched the script should run once only can someone limit this please.
heres the script.
local house = script.Parent.Parent;
script.Parent.Touched:connect(function (h) if (not h.Parent:findFirstChild("Humanoid")) then return; end local plr = game.Players:findFirstChild(h.Parent.Name); if (not plr) then return; end local plrID = plr:findFirstChild("AgentID"); if (not plrID) then return; end
local ownerID = house.Parent.Parent; if (ownerID.Name ~= 7) then if (plrID.Value == ownerID.Name) then return end local stats = plr:findFirstChild("leaderstats"); if (not stats) then return; end local cash = stats:findFirstChild("Cash"); if (not cash) then return; end if (cash.Value >= 0) then cash.Value = cash.Value + house.HouseValue.Value; house.Parent = workspace:findFirstChild("7").Factory; print("House is now owned by the Government"); end end end); |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2013 02:38 PM |
| and thus it shall be bumped |
|
|
| Report Abuse |
|
|
rrytry
|
  |
| Joined: 21 Aug 2012 |
| Total Posts: 4151 |
|
| |
|
|
| 18 Mar 2013 02:45 PM |
in the last script (older version of this) it wasnt functioning at all but nothing came up in the output...
and now its functions maybe 2 - 3 times per touch on the button and all the output shows is the print(the government owns this now) line and i cant figure it out? |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2013 04:16 PM |
Bump
also @ thedestroyer : my previous thread on this topic was mainly aimed at dr01d3k4 because he helped me with the script. So i apologize if i gave off the wrong idea that only he could help. and would greatly appreciate your help. |
|
|
| Report Abuse |
|
|