Not sure what i'm doing wrong, i have FE turned on and the script works in the studio but not in the game. It's a GUI script that is supposed to pop up when a player touches a brick, but won't work in studio. (Yes, it's a localscript).
local player = script.Parent.Parent.Parent.Parent
function sell(part)
if part.Parent:FindFirstChild("Humanoid") then
player:WaitForChild("TotalFood")
local SellCount = player.TotalFood.SCount.Value
local SellValue = player.TotalFood.SValue.Value
if SellCount >=0.1 then
player.PlayerGui.Gui:WaitForChild("Sold").Visible = true
player.PlayerGui.Gui.Sold.Text = ("Successfully Sold ".. SellCount .. " Items for $".. SellValue .." !")
wait(2)
player.PlayerGui.Gui.Sold.Visible = false
end
end
end
game.workspace.Sellbrick.Touched:connect(sell)
