i need some help with my proximity prompt, once you buy activate the prompt if you have enough Cash then it does an action. but i cant find the right script, can anyone help?
2 Likes
Could you please give more infos? I don’t really understand what you are saying.
so, i have a proximity prompt. as shown in the image bellow, and once you activate it i need it to run some script,
Hmmm okay so if I understand correctly, you want to buy the next stage with the prompt right?
yes i do, i looked at the official page for promts but i just dont understand how the script works
local ProximityPrompt = script.Parent
local Price = 250
ProximityPrompt.Triggered:Connect(function(Player)
if Player:FindFirstChild("leaderstats") then
if Player.leaderstats:FindFirstChild("Money") then
if Player.leaderstats:FindFirstChild("Money").Value >= Price then
end
end
end
print(Player.Parent.Name)
end)
this should work i think
Alrighty. I’ll help you out.
local prompt = script.Parent
local stagePrice = 100 -- Change the number if you want, this will be the price of the stage.
prompt.Triggered:Connect(function(player) -- When you trigger the prompt
if player.leaderstats["Insert your currency here!"].Value >= stagePrice then
-- Do stuff
end
if player.leaderstats["Insert your currency here!"].Value < stagePrice then
-- print("Not enough cash!")
end
end)
1 Like