Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

? My GUI will not show up after I die even when I try to equip the tool

Asked by
h0730 -55
5 years ago

My GUI won't show up after I die and equip

  wait(1)



tool = script.Parent

pmouse = game.Players.LocalPlayer:GetMouse()

switch = false

localp = game.Players.LocalPlayer

enabled = false

sound = script.Parent.Handle.beep

loadgui = false



tool.Equipped:connect(function()

enabled = true

--game.Workspace.RadioFE.givegui:FireServer()

if loadgui == false then

local gui = script.Parent.Radio

gui.Frame.Line7.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L7.Value

gui.Frame.Line6.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L6.Value

gui.Frame.Line5.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L5.Value

gui.Frame.Line4.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L4.Value

gui.Frame.Line3.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L3.Value

gui.Frame.Line2.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L2.Value

gui.Frame.Line1.Text = game.Workspace.RadioFE.givegui.Radio.Frame.L1.Value

script.Parent.Radio.Parent = localp.PlayerGui

loadgui = true

end

end)







pmouse.Button1Down:connect(function()

if enabled == true then

if switch == false then

game.Workspace.RadioFE.sound:FireServer(sound)

switch = true

game.Workspace.RadioFE.color:FireServer("Lime green", tool.Light)

elseif switch == true then

game.Workspace.RadioFE.sound:FireServer(sound)

switch = false

game.Workspace.RadioFE.color:FireServer("Really red", tool.Light)

end

end

end)



tool.Unequipped:connect(function()

game.Workspace.RadioFE.sound:FireServer(sound)

switch = false

tool.Light.BrickColor = BrickColor.new("Really red")

enabled = false

end)



localp.Chatted:connect(function(msg)

if switch == true then

game.Workspace.RadioFE.sound:FireServer(sound)

game.Workspace.RadioFE.chat:FireServer(msg)

end

end)
0
Try cloning the GUI into the PlayerGui instead of just setting its Parent to it. To make this work properly, connect a function to the Humanoid's Died event and destroy the clone when the Humanoid dies. DeceptiveCaster 3761 — 5y
0
Or destroy the clone when the tool is unequipped. DeceptiveCaster 3761 — 5y

Answer this question