Hi I am trying to make player pay Money to unlock a certain team. local script in Gui button
script.Parent.MouseButton1Click:Connect(function()
local leaderstats = Instance.new("Folder")
local sp = leaderstats:findFirstChild("Money")
if sp == nil then return false end
if (sp.Value >=100) then --Amount of how much the weapon will go for
sp.Value = sp.Value - 100
local team = script.Parent.Name
game.ReplicatedStorage.ChangedTeam:FireServer(team)
end
end)
No errors

1 comment
Thank you so much