#Click radio so radio GUI would pop up

1 messages · Page 1 of 1 (latest)

winged sky
#

local player = game.Players.LocalPlayer

repeat wait() until player.Character

local currentgui = nil

script.Parent.Equipped:Connect(function(mousebutton1clicked)
button.mousebutton1click:Connect(function(Enable GUI)
if currentgui == nil then
local radioGui = script.Parent:FindFirstChild("RadioGui")
if radioGui then
currentgui = radioGui:Clone()
currentgui.Parent = player.PlayerGui
end
end
end)
end)

script.Parent.Unequipped:Connect(function()
if currentgui ~= nil then
currentgui:Destroy()
currentgui = nil
end

if script.Parent:FindFirstChild("NewSong") then
    script.Parent.NewSong:FireServer(0)
end

end)

karmic geyser
#

ur code is broken? Or

winged sky
#

no because

#

this script is from a boombox

#

when you click the screen

#

the radio GUI pops up

#

but that's for the starter pack

#

I'll be placing this radio on a car

#

and I want the radio GUI to pop up when you click the radio

#

do you get it?

karmic geyser
#

ok have you tried?

#

its pretty much the same system as the code you sent

winged sky
#

I tried to script but no use

#

yeah but

#

it says mouse

#

how do I change it to when you click it, it also pops up

karmic geyser
#

Well

#

Use mousebutton1clicked

#

button.mousebutton1click

#

Connect function

#

Enable gui

winged sky
#

same script?

rigid beaconBOT
#

studio** You are now Level 1! **studio

winged sky
#

oh sorry

#

I get it

#

local player = game.Players.LocalPlayer

repeat wait() until player.Character

local currentgui = nil

script.Parent.Equipped:Connect(function(mousebutton1clicked)
button.mousebutton1click:Connect(function(Enable GUI)
if currentgui == nil then
local radioGui = script.Parent:FindFirstChild("RadioGui")
if radioGui then
currentgui = radioGui:Clone()
currentgui.Parent = player.PlayerGui
end
end
end)
end)

script.Parent.Unequipped:Connect(function()
if currentgui ~= nil then
currentgui:Destroy()
currentgui = nil
end

if script.Parent:FindFirstChild("NewSong") then
    script.Parent.NewSong:FireServer(0)
end

end)

#

could you check what's wrong

#

I'm not that experienced yet

karmic geyser
#

do you even have a tool

#

being equipped

#

.Equipped is used for tools

#

If u haven’t got a tool delete it

#

If u only want it to pop up when the button is pressed or whatever

#

Is radio a tool or?

#

A button

winged sky
#

tool