Advertisement
GaryScripts

Roblox Simulator Tool Code

Nov 30th, 2019
4,490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. -- LocalScript for activation of tool (put both of these scripts inside  a tool.)
  2.  
  3. local Tool = script.Parent
  4.  
  5. Tool.Activated:Connect(function()
  6.     if Tool.Parent == game.Players.LocalPlayer.Character then
  7.         script.Parent.GainCurrency:FireServer()
  8.     end
  9. end)
  10.  
  11. -- Script for the tool when server is fired.
  12.  
  13. local ClickValue = script.Parent.ClickValue
  14. script.Parent.GainCurrency.OnServerEvent:Connect(function()
  15.     local Points = game.Players[script.Parent.Parent.Name].leaderstats.Points
  16.     Points.Value = Points.Value + ClickValue.Value
  17. end)
  18.  
  19. -- All you need for the script is: RemoteEvent, LocalScript, Script, Part Called Handle, And an IntValue called ClickValue. (also don't forget about the tool.)
  20.  
  21. -- Made by: GaryScripts on Pastebin.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement