I need help with this script! So I need help with this. I was trying to make something whare if you were to click a button it wouild check at your leaderstats and see if you have 900,000 "Car cash". Then you have it it will teleport you to somewhare if you don't it will clone a gui that says error then after 5 seccents it will close it. Please help as im geting errors and im not very good with this kind of scripting C:.
local plr = game.Players.LocalPlayer
local Gui = game.StarterGui.Error
script.Parent.MouseButton1Click:connect(function()
if plr.leaderstats.CarCash.Value >= 900000 then
game.Workspace.Player.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-994.023, -11.5, 155.904))
else
Gui:Clone()
wait(5)
Gui:Destory()
end
