local Buttons = script.Parent
for i,v in Buttons:GetChildren() do
if v:IsA("BasePart") then
local deb = false
v.Touched:Connect(function(H)
if not deb and not v:GetAttribute("Completed") and H:FindFirstAncestorWhichIsA("Model").Humanoid then
local Char = H:FindFirstAncestorWhichIsA("Model")
local Player = game.Players:GetPlayerFromCharacter(Char)
if Player.leaderstats.Money.Value > 500 then
deb = true
print(Player.leaderstats.Money.Value)
wait(2)
deb = false
else
deb = true
warn("You Require "..tostring(500-Player.leaderstats.Money.Value))
wait(2)
deb = false
end
end
end)
end
end
This is a Script my Friend Gave me to Fix…
i first tried it noticed nothing then realised i didnt set up the leaderstats so i started to set it up. now when the Leaderstats were ready when i stepped on it without any money (0) it was working and warned perfectly…
it was until i used the command bar to give my self 500+ coins like this:
Hello! I have fixed your script, sorry it took a while but here is the script!
local Buttons = script.Parent
for i,v in Buttons:GetChildren() do
if v:IsA("BasePart") then
local deb = false
v.Touched:Connect(function(H)
if not deb and not v:GetAttribute("Completed") and H:FindFirstAncestorWhichIsA("Model").Humanoid then
local Char = H:FindFirstAncestorWhichIsA("Model")
local Player = game.Players:GetPlayerFromCharacter(Char)
if Player.leaderstats.Money.Value > 500 then
deb = true
print("Player has enough")
wait(2)
deb = false
else
deb = true
warn("You Require 500")
wait(2)
deb = false
end
end
end)
end
end
All commands ran on the command line actually isn’t ran on the server, its ran on the current mode. Are you sure you changed the mode to Server and then ran it?