i cant make this work with both character types
game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function() script:WaitForChild("Music") script:WaitForChild("RadioGui") game.Workspace:WaitForChild(Player.Name) local Sound = script.Music:Clone() local Gui = script.RadioGui:Clone() Sound.Parent = Player.Character.Torso --<-- this line wait(1) Gui.Parent = Player.PlayerGui Gui.Enabled = true end) end)
I fixed that this is another script but they are similar
game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function() script:WaitForChild("Radio") script.Radio:WaitForChild("RadioGui") game.Workspace:WaitForChild(Player.Name) local Radio = script.Radio:Clone() local Gui = script.Radio.RadioGui:Clone() local Weld = Instance.new("ManualWeld") Radio.Parent = Player.Character Radio.Transparency = 0 Radio.Anchored = false if Player.Character:WaitForChild("Torso") then Weld.Parent = Radio Weld.Part0 = Radio Weld.Part1 = Player.Character.Torso else Weld.Parent = Radio Weld.Part0 = Radio Weld.Part1 = Player.Character.UpperTorso end Weld.C0 = CFrame.new(0.25, 0.55, 0.75, -1, 0.3, 0, 0.3, 1, 0, 0, 0, -1)*CFrame.new(0, -math.pi/5, 0) wait(1) Gui.Parent = Player.PlayerGui Gui.Enabled = true end) end)
A check for what RigType
the player is using would be good, make a line of code for each one
game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function() script:WaitForChild("Music") script:WaitForChild("RadioGui") game.Workspace:WaitForChild(Player.Name) local Sound = script.Music:Clone() local Gui = script.RadioGui:Clone() Player.Character:WaitForChild("Humanoid") if Player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then Sound.Parent = Player.Character.UpperTorso else Sound.Parent = Player.Character.Torso end wait(1) Gui.Parent = Player.PlayerGui Gui.Enabled = true end) end)