Advertisement
OnFireRobloxScriptin

Buy Item localscript

Mar 26th, 2024
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. --//Variables
  2. local BuyRE = game.ReplicatedStorage:WaitForChild("Buy") --Variable for the buy remote event
  3. local BuyButton = script.Parent --Variable for the buy button
  4.  
  5. BuyButton.MouseButton1Click:Connect(function() --When the buy button is clicked
  6.     BuyRE:FireServer("Classic Sword") --Send the remote event with the string of item we want to buy (Which happens to be "Classic Sword" in this case)
  7. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement