Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how i can delete my radio in playergui and character?

my friend hate my radio script and i want to make button that delete radio in hes character

how look path to radio:

game.workspace.MYFRIEND.Radio (boombox mesh)

also i tried to make my own script but error "bad argument #2 to '?' (string expected, got Object)" ruin this

local LocalPlayer = game.Players.LocalPlayer
local Radio = game.Workspace[LocalPlayer]:WaitForChild("Radio")
local RadioGui = LocalPlayer.PlayerGui:WaitForChild("RadioGui")
Radio:Destroy()
RadioGui:Destroy()

1 answer

local LocalPlayer = game.Players.LocalPlayer
local Radio = game.Workspace[LocalPlayer.Name]:WaitForChild("Radio")
local RadioGui = LocalPlayer.PlayerGui:WaitForChild("RadioGui")
Radio:Destroy()
RadioGui:Destroy()

3 comments

0

you put in an object in the '[]' when you were supposed to put in a string :P

0

should be getting the player's character by saying LocalPlayer.Character, but this works too. also, sometimes the players character might not be in the workspace in situations when the player is respawning. keep that in mind,

0

yeah, I was referring to what caused the problem but ye

This discussion is preserved as it was. New answers, comments, and votes are closed.