Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Make A BUY Button That Takes Away Money And Gives An Item?

Asked by 3 years ago
Edited 3 years ago

this is a bit of code i tried and it worked (i got the item) but it didnt takeaway money can anyone help?

function Give(x)
    local y = x.Backpack
    local z = game.Lighting["Octopus"]
    z:Clone().Parent = y   
end

script.Parent.ClickDetector.MouseClick:connect(Give)
0
It's because you never programmed it to do so. Access the Player's leaderstats via the Player pointer passed from MouseClick, modify the respective stat. Please also use ReplicatedStorage to store Instances. ROBLOX methods now follow title-case, please use :Connect(). Ziffixture 6913 — 3y

1 answer

Log in to vote
-2
Answered by 3 years ago
Edited 3 years ago

you need to make a local script where you going to click the button and then make a event to prevent hackers and check if the player have enough money if he do you going to take away money copy the item and put it in the player inventory this is the best answer you can get because its more then just a script

0
Do u mind showing me what the script would look like? im new to scripting and i dont understand alot of what you said jumpy_legs 12 — 3y
0
This isn't needed. Ziffixture 6913 — 3y
0
Jumpy he doesn't know how to script, he's a troll. M9F 94 — 3y
0
oh ok thanks jumpy_legs 12 — 3y
View all comments (2 more)
0
Please do not post answers without code or proper explanations. Use comments for ideas like this but no answer. AlexanderYar 788 — 3y
0
you guys are so dump I can show you the whole prosses you need a more then one scripts and events and remote functions and if you think I'm a troll and I don't know how to script go to Roblox games search up Free Shot and see my game Xx0966xX 41 — 3y
Ad

Answer this question