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: Probably easy to fix

Previous Thread :: Next Thread 
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:30 PM
-- START OF CODE
rap = plr.Data.RAP
bux = plr.Data.ROBUX


script.Parent.MouseButton1Click:connect(function()
bux.Value = bux.Value + rap.Value - 30%
rap.Value = rap.Value - rap.Value
end
--END OF CODE


dont work

if i remove - 30% it does however


Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:31 PM
What do you want 30% of


#code print("oh no an errorz!")
Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:35 PM
i would like it so if the player sells their rap buy clicking this button it takes 30% from their rap so it would be like roblox's selling system


Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:37 PM
im guessing you want 30% of bux.Value + rap.Value and subtract that from bux.Value + rap.Value

didn't test but you can try this


rap = plr.Data.RAP
bux = plr.Data.ROBUX


script.Parent.MouseButton1Click:connect(function()
bux.Value = (bux.Value + rap.Value) - (0.30 x (bux.Value + rap.Value))
rap.Value = rap.Value - rap.Value -- im confused. rap.Value will always be 0?
end


#code print("oh no an errorz!")
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:37 PM
@hook, I posted that before noticing you replied to me, one moment


#code print("oh no an errorz!")
Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:37 PM
thanks for the help!

now i can continue to hopefully finish the save data


Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:38 PM
oh it worked?


#code print("oh no an errorz!")
Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:38 PM
idk i didnt try i said that then went to try but when i posted i saw that


Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:40 PM
btw if you want it to take 30% of rap its not that hard

rap.Value = rap.Value - (rap.Value x 0.30) -- sets rap.Value to rap.Value minus rap.Value times 0.30 (gets 30% of raps Value). easy math??


#code print("oh no an errorz!")
Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:40 PM
15:39:33.336 - Players.Player1.PlayerGui.Game.SellRap.Script:8: ')' expected (to close '(' at line 5) near


Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:41 PM
also instead of x you gotta use *


Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:43 PM
you forgot a ) at the end

-- old script i posted
rap = plr.Data.RAP
bux = plr.Data.ROBUX


script.Parent.MouseButton1Click:connect(function()
bux.Value = (bux.Value + rap.Value) - (0.30 x (bux.Value + rap.Value))
rap.Value = rap.Value - rap.Value -- im confused. rap.Value will always be 0?
end) -- you forgot the ) right next to the end in your original script and so did I lol.


-- new script Im posting because I think I did what you wanted wrong!

rap = plr.Data.RAP
bux = plr.Data.ROBUX


script.Parent.MouseButton1Click:connect(function()
bux.Value = bux.Value + rap.Value
rap.Value = rap.Value - (0.30 x rap.Value) -- sets raps Value to 30% of raps original value - 30% of it
end)




#code print("oh no an errorz!")
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:44 PM
oh sorry, lol I dont use multiplication in roblox much


#code print("oh no an errorz!")
Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:46 PM
i changed it a bit but it works great!

#Code
plr = script.Parent.Parent.Parent.Parent
rap = plr.Data.RAP
bux = plr.Data.ROBUX


script.Parent.MouseButton1Click:connect(function()
bux.Value = bux.Value + (rap.Value * 0.30) -- sets rap.Value to rap.Value minus rap.Value times 0.30 (gets 30% of raps Value). easy math??
rap.Value = rap.Value - rap.Value
end)
#Code


while true do
Report Abuse
Hookyto is not online. Hookyto
Joined: 15 Jan 2010
Total Posts: 80
31 May 2017 05:47 PM
this is the game bty

https://www.roblox.com/catalog/844277221/redirect



while true do
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
31 May 2017 05:49 PM
game is closed


#code print("oh no an errorz!")
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