generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: multiple fire function

Previous Thread :: Next Thread 
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
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
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
18 Mar 2013 02:38 PM
and thus it shall be bumped
Report Abuse
rrytry is not online. rrytry
Joined: 21 Aug 2012
Total Posts: 4151
18 Mar 2013 02:42 PM
[ Content Deleted ]
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
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
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image