Since An Roblox Update, The GUIs Used For The Tycoon Are Broken. The "Become Owner" Thing And Buttons Doesn't Disappear (Transparent) Unlike Before. In Studio Mode Everything Works Fine But In Roblox Player It Doesn't. On The Dev Console, It Says That The Error Is On Line 32. There's The Script Bellow And Thanks For Helping :)
local main = script.Parent.Parent.Parent
local owner = main.Owner
local tn = main.Parent.TycoonName
local debounce = false
script.Parent.Touched:connect(function(hit)
if (debounce == false) then
debounce = true
local h = hit.Parent:FindFirstChild("Humanoid")
if (h ~= nil) then
local p = game.Players:FindFirstChild(hit.Parent.Name)
if (p ~= nil) then
if p.Tycoon.Value == true then
for GuiReveal = 1, 0, -0.05 do
p.PlayerGui.TycoonGui.Notice.Text = "You already have a "..tn.Value.."!"
p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(0, 0, 0, 50), Out, Quad, 0.5, false)
p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
wait()
end
wait(3)
for GuiReveal = 0, 1, 0.15 do
p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(-1.2, 0, 0, 50), Out, Quad, 0.5, false)
p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
wait()
end
wait(2)
debounce = false
return end
owner.Value = p.Name
p.Tycoon.Value = true
for GuiReveal = 1, 0, -0.05 do
p.PlayerGui.TycoonGui.Notice.Text = "You now own a "..tn.Value..", "..p.Name.."!"
p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(0, 0, 0, 50), Out, Quad, 0.5, false)
p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
wait()
end
main.Sign:remove()
wait(3)
for GuiReveal = 0, 1, 0.15 do
p.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(-1.2, 0, 0, 50), Out, Quad, 0.5, false)
p.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal
wait()
end
for i = 0.4, 1, 0.02 do
wait()
script.Parent.Transparency = i
end
script.Parent.Parent:remove()
end
end
wait(2)
debounce = false
end
end)

7 comments
The reason for that is because the server can not access the player's PlayerGui. You will want to use remote events. Also, :remove and :connect are deprecated, use :Destroy and :Connect.
So By Using Remote Events And Replacing :remove and :connect Would It Fix The Problem Or I Will Need To Do The Same For The Button's scripts? (The Buttons We Go On To Buy / Unlock Stuff)
The remote event will allow for the GUIs to show, and you should replace :connect and :remove them because they are deprecated, and deprecated items should not be used in new work. They can be removed by Roblox at any time, and if that happens your scripts will break. Most important one to not use is :remove though. Using :remove simply sets the parent property to nil, so it still exists.
:Destroy on the other hand does the same, but it locks the parent property; it can't be reparented. It also prepares the object for garbage collection, and when there' are no more references to the object, it gets garbage collected.
You can read more about that here: https://scriptinghelpers.org/blog/do-you-have-zombies-in-your-code they refer to it as a code zombie.
Wow That Really Well Explained Thanks :D
But About Remote Events, Is There A place Or Any tools I Can Use To Learn Using Them?