Robbing/Earning Money

This shows you how to make a robbable store in LUA

by XxMouseRatRockBandxX

Author Avatar

Introduction

Hello there, i am assuming your new to LUA so in this one i will be teaching you how to make a FE robbable store without any remote events or such kind!

What you need

You will need a part, a server script, a click detector and a brain (make sure your server script and click detector are inside your part)

Making it

So to start this off left click twice on the server script to open it and write this (the explanations will be in the code itself)

local earn = math.random(1,5) -- Chooses from 1 to 5 randomly
 (you can always add more but remember to change 5 value for the amount that u have)
if earn == 1 then --1
    earn = 10 -- Gives the value 10
 (if you want you can change the value to whatever you want)
end
if earn == 2 then --2
    earn = 20 -- Gives the value 20
 (if you want you can change the value to whatever you want)
end
if earn == 3 then --3
    earn = 30 -- Gives the value 30
 (if you want you can change the value to whatever you want)
end
if earn == 4 then --4
    earn = 40 -- Gives the value 40
 (if you want you can change the value to whatever you want)
end
if earn == 5 then --5
    earn = 50 -- Gives the value 50 (if you want you can change the value to whatever you want)

end

script.Parent.ClickDetector.MouseClick:connect(function(player) -- When part is clicked
    player.Stats.Cash.Value = player.Stats.Cash.Value + earn -- Adds the value to your cash
(so remember to change both Stats to your folder name and change Cash to your int value name)
    script.Parent.Position = Vector3.new(0,-10,0) -- Makes the part in a different position based on the vector3
 (so remember to set the Vector3.new(0,-10, 0) where you want it to hide)
    wait(300) --Waits 5 minutes for the part to respawn
    script.Parent.Position = Vector3.new(0, 0, 0) -- Makes the part return back to its original position (so remember to set the Vector3.new(0, 0, 0) to your original position from your part)
end)

Conclusion

There you have it, you just made your FE robbable store for your game! Have a nice day

View in-game to comment, award, and more!