script.Parent.MouseButton1Click:connect(function(Hit)
pcall(function()
local p = game.Players:GetPlayerFromCharacter(Hit.Parent):WaitForChild("Folder"):WaitForChild("Buns")
if p.Value>= 2
then print("Yay")
end
end)
end)
This script is attempting to check if a players "Buns" Value equals more then 2 or is equal to 2. There is no errors, but it does not function.
script.Parent.MouseButton1Click:connect(function(Hit)
local p = game.Players:GetPlayerFromCharacter(Hit.Parent):WaitForChild("Folder"):WaitForChild("Buns")
if p.Value>= 2
then print("Yay")
end
end)
This script does error. the only thing removed though is PCALL.
21:25:02.248 - Workspace.Part.SurfaceGui.Frame.Blue Pen.Script:2: attempt to index local 'Hit' (a nil value) 21:25:02.248 - Stack Begin 21:25:02.249 - Script 'Workspace.Part.SurfaceGui.Frame.Blue Pen.Script', Line 2 21:25:02.249 - Stack End
((And yes, The Buns is set to 2.))

1 comment
Oh. Lovely. Welp im just gonna stick to screen gui's theenn