i make a portal gun that showed a "ScreenGui" when you equip it. its look fine on the studio but when you test it in the servers the ScreenGui wont showed up. here the script that i wrote.
portal = false dimension = false appear = false the = script.Parent.Val.Value function wormhole() local c = script.Parent.ScreenGui:Clone() c.Parent = game.Players.LocalPlayer.PlayerGui c.TextButton.MouseButton1Click:connect(function() script.Parent.Val.Value = c.TextBox.Text local wormhole = Instance.new("Part") wormhole.Size = Vector3.new(5,5,0.2) wormhole.Name = "Hole" wormhole.Parent = game.Workspace wormhole.CFrame = script.Parent.Handle.CFrame wormhole.Anchored = true local click = Instance.new("ClickDetector") click.Parent = game.Workspace.Hole click.MouseClick:connect(function(player) game:GetService("TeleportService"):Teleport(script.Parent.Val.Value,player) end) wait(5) wormhole:remove() end) end script.Parent.Equipped:connect(wormhole) function remove() game.Players.LocalPlayer.PlayerGui.ScreenGui:remove() end script.Parent.Unequipped:connect(remove)
Closed as Non-Descriptive by Goulstem
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?