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

How to Make This door take Cash away and save when bought?

Asked by 4 years ago

So someone helped me with this door but It does not save on rejoin and it does not take away the Cash or (Sips) Can you help me make it save and MOSTLY Take away cash?

local _M = require(script.Parent.Settings)

script.Parent.Touched:Connect(function(hit)
    local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

    if plr then
        local rebirths = plr.leaderstats.Sips

        if rebirths.Value >= _M.RequiredSips then
            script.Parent.CanCollide = false
            wait(.5)
            script.Parent.CanCollide = true
        end
    end
end)

2nd script if you need it

local module = {
    areaName = "Lava",
    RequiredSips = 20000
}

return module
0
See <a href="https://developer.roblox.com/en-us/articles/Data-store"> DataStores </a> Thetacah 712 — 4y
0
I am new I need help like a script. JuzeyPlayz -83 — 4y
0
this is not a request site, if you don't know how to script we will point you in the right direction, but we will not make it for you jediplocoon 877 — 4y
0
Dude stop telling me that Im not requesting anything I put the script I TRIED and if it does not work I put it here and people normally help teach me how to fix it not send me to Roblox page I already read that I just need help! JuzeyPlayz -83 — 4y
View all comments (6 more)
0
If you went to the link Thetacah pointed out, it tells you exactly how to save data, which is what you were asking, your script does not use any data stores, so therefor it doesn't save any data for the player jediplocoon 877 — 4y
0
Can you please at least add a part where it takes away money? I dont know how to do that. JuzeyPlayz -83 — 4y
0
plr.leaderstats.Sips.Value = plr.leaderstats.Sips.Value - 20000 jediplocoon 877 — 4y
0
Thank u but where do I put it in the group? JuzeyPlayz -83 — 4y
0
you would put it after you check to see if you have the required sips, then before the door opens take away the sips jediplocoon 877 — 4y
0
ok thak U JuzeyPlayz -83 — 4y

Answer this question