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 » Scripters
Home Search
 

Re: I've been trying to fix this for 30 minutes...

Previous Thread :: Next Thread 
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 04:51 PM
Here is the script:

local player = game.Players.LocalPlayer
local mg = script.Parent:WaitForChild("HireMoney")
Bought = script.Parent.Bought.Value
Boguht = false
HireCost = 10
script.Parent.MouseButton1Click:connect(function(Building)
if player:FindFirstChild('leaderstats').Cash.Value >= HireCost then
Bought = true
HireCost = HireCost * 2
if Bought == true then
mg.Value = mg.Value + 1
end
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - HireCost
while wait(.5) do
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + mg.Value
end
end
end)

When you click the button it buys a worker for you then it gives you how much the HireMoney is over .5 seconds and the hire cost is doubled. But it will not buy it when I click. Wont even work in studio. Please Help me


+1 Forum post
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 04:52 PM
Every .5 seconds*


+1 Forum post
Report Abuse
Vortilis is not online. Vortilis
Joined: 06 Jul 2014
Total Posts: 14163
05 Nov 2016 04:57 PM
http://wiki.roblox.com/index.php?title=Intro_to_Scripting


Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 04:59 PM
I've already looked through the wiki. But thanks.


+1 Forum post
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
05 Nov 2016 05:04 PM
Take out the while loop.
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 05:05 PM
Then how would I make it give Cash every .5 seconds?


+1 Forum post
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
05 Nov 2016 05:11 PM
Put that in a different script.
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 05:17 PM
Still will not work.


+1 Forum post
Report Abuse
Briicks is online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
05 Nov 2016 06:08 PM
"Boguht"?
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 06:32 PM
I fixed that in the script. It wont work. Besides this is old I already got help on a different website(ScriptHelpers). But it only works in studio.


+1 Forum post
Report Abuse
ASAP_Bang is not online. ASAP_Bang
Joined: 21 Jan 2013
Total Posts: 116
05 Nov 2016 06:34 PM
scriptinghelpers(DOT org)(SLASH)questions(SLASH)36914(SLASH)ive-been-trying-to-fix-this-for-30-minutes-any-way-to-fix-this-scriptedited


+1 Forum post
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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