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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Money giver? (MouseButton1Click)

Previous Thread :: Next Thread 
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
29 Apr 2017 01:58 PM
Since I quit scripting for a while I can't find a way to get this to work. I've been looking around but nothing seems helpful. Any ways?


Report Abuse
Cyrakohl is not online. Cyrakohl
Joined: 09 Nov 2014
Total Posts: 3197
29 Apr 2017 01:59 PM
A part or a text button?.


Report Abuse
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
29 Apr 2017 02:03 PM
Textbutton. I made a working one but only worked in studio :S


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
29 Apr 2017 02:04 PM
This should be in the guibutton object. Put a RemoteEvent in ReplicatedStorage named Money.
---------------------------------------

local plr = game.Players.LocalPlayer;
local re = game.ReplicatedStorage.Money;
local moneyStatName = "Money"; --Name of your money stat
local amount = 100; --amount to give

script.Parent.MouseButton1Down:Connect(function()
local stat = plr.leaderstats:FindFirstChild(moneyStatName);
if stat then
re:FireServer(amount);
else
print("Money stat not found");
end
end)


This should be in serverscriptstorage
------------------------------------

local re = game.ReplicatedStorage.Money;

re.OnServerEvent:Connect(function(c,amount)
local stat = c.leaderstats:FindFirstChild(moneyStatName);
if stat then
stat.Value = stat.Value + amount;
end
end)


Report Abuse
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
29 Apr 2017 02:06 PM
I'm not using a local script for this. But thanks anyways. I found a fix. Might save it for later if mine breaks. xD


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
29 Apr 2017 02:07 PM
You should be since MouseButton1Click is only used for guis


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
29 Apr 2017 02:08 PM
Don't even try.


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
29 Apr 2017 02:28 PM
lmao


Report Abuse
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
29 Apr 2017 03:42 PM
I am using GUI's.


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
29 Apr 2017 06:55 PM
LocalScripts should be used with Guis.


Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
29 Apr 2017 06:59 PM
Cyber is too stubborn to use local scripts when they should be used.
Report Abuse
ForceCyber is not online. ForceCyber
Joined: 06 May 2015
Total Posts: 1086
29 Apr 2017 07:17 PM
If it works, there's no need to make it more advanced. No comment.


Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
29 Apr 2017 07:19 PM
Using a server script to change a gui is like using deprecated things(like :Remove() or Keyboard input) while knowing they're deprecated, all it shows is that you're too lazy to do something right.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
29 Apr 2017 07:47 PM
OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

lmfao

burn















need sum ice bruh?


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