I have this gamepass script that adds a boombox to the players back, and when they have the gamepass they get the boombox perfectly. But whenever the player resets or dies from something the boombox orientation is all wrong on respawn, instead of being on the back slanted at a 45 degree angle, its piercing through the entire body. Help?
local RADIO_REMOTE=Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
RADIO_REMOTE.Name="BoomboxEvent"
local MarketplaceService=game:GetService("MarketplaceService")
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
if MarketplaceService:UserOwnsGamePassAsync(plr.UserId, 5068130) then
if char~=nil then
local torso=char:FindFirstChild("Torso")
if torso~=nil then
local boombox=game:GetService("Lighting").GamepassBoombox:Clone()
boombox.Parent=torso
boombox.Position=Vector3.new(torso.Position.X-.7,torso.Position.Y,torso.Position.Z)
boombox.Orientation=Vector3.new(0, 90, 45)
local Constraint=Instance.new("WeldConstraint",torso)
Constraint.Part0=boombox
Constraint.Part1=torso
end
end
else
if char~=nil then
local torso=char:FindFirstChild("Torso")
if torso~=nil then
local boombox=game:GetService("Lighting").Boombox:Clone()
boombox.Parent=torso
boombox.Position=Vector3.new(torso.Position.X-.7,torso.Position.Y,torso.Position.Z)
boombox.Orientation=Vector3.new(0, 90, 45)
local Constraint=Instance.new("WeldConstraint",torso)
Constraint.Part0=boombox
Constraint.Part1=torso
end
end
end
end)
end)
RADIO_REMOTE.OnServerEvent:Connect(function(player,id)
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, 5068130) then
if player.Character~=nil and player.Character.Torso:FindFirstChild("GamepassBoombox")~=nil then
local boombox=player.Character.Torso.GamepassBoombox
local Sound=boombox:FindFirstChild("AUDIO")
id = id or ""
if id~=0 and id~="" then
Sound:Stop()
Sound.SoundId = "http://www.roblox.com/asset/?id="..id
Sound:Play()
else
Sound:Stop()
end
end
else
if player.Character~=nil and player.Character.Torso:FindFirstChild("Boombox")~=nil then
local boombox=player.Character.Torso.Boombox
local Sound=boombox:FindFirstChild("AUDIO")
id = id or ""
if id~=0 and id~="" then
Sound:Stop()
Sound.SoundId = "http://www.roblox.com/asset/?id="..id
Sound:Play()
else
Sound:Stop()
end
end
end
end)

1 comment
Hi, I think your problem may lie with Humanoid.BreakJointsOnDeath.