I am making a quest system. I’ve made a point system and named it Coins. player.leaderstats.Coins.Value = 125
Then, script.Parent.Parent.Point1.Visible = false script.Parent.Visible = true
Do I make it a Local Script? I’m very confused about what to do. I have searched around the DevForum and I couldn’t find a similar topic?
Do this is in a local script. Exploiters viewing GUIs they’re not supposed to won’t actually break your game.
Firstly, make a function that checks the coins value before updating the GUIs. If it’s just to show how many coins, set the Text property to the same as the coins Value property. I’m guessing your scenario is more sophisticated, so you may need to run a couple if statements to verify which GUIs should be open based off the coins.Value. Use inequality signs < and > to help you.
At the end of the script, simply bind this function to this event:
For anyone who doesn’t know my situation. As I said, I’m making a Quest system.
I want to make a script that when you reach 125 Coins it will activate a ProximityPrompt and the GUI changes.
player.leaderstats.Coins.Value = 0
player.leaderstats.Coins.Value = 125
This is my script:
if player.leaderstats.Coins.Value >= 125 then
game.Workspace.Part.ProximityPrompt.Enabled = true
script.Parent.Parent.Point1.Visible = false
script.Parent.Visible = true
end
My script doesn’t work, Mind helping me out? Any sort of help and support is wanted and is appreciated by anyone here!
Your script should work perfectly. The only thing you haven’t done correctly is connect it to a Changed event:
function verifyCoins(player)
if player.leaderstats.Coins.Value >= 125 then
game.Workspace.Part.ProximityPrompt.Enabled = true
script.Parent.Parent.Point1.Visible = false
script.Parent.Visible = true
else return "NAN" end
end
game.Players.PlayerAdded:Connect(function(plr)
-- Data store code and value instancing goes here
if verifyCoins(plr) == "NAN" then
plr.leaderstats.Coins.Changed:Connect(function()
verifyCoins(plr)
end)
end
end)
I’m not sure why it didn’t work since it is fine and there was no error in the Output. Where do I place my script? But for now, I’ll mark you as a Solution Post since I find that there is no error in the Script. But it somehow doesn’t work.
The script should be placed in ServerScriptService.
Also, if it still doesn’t work, rewrite the code within the if statement of the “verifyCoins” functions. It’s probably to do with these instances; I had no further insight into them.