Ok so this script copies a killbrick into the characters head, then it adjusts it so that the killbrick is facing the characters head. This is not happening in my script, the orientation keeps changing for some reason and it is not accurate
Script:
Players.PlayerAdded:Connect(function(player)
player:GetPropertyChangedSignal("Team"):Connect(function()
if player.Team == KillerTeam then
if player.Team == KillerTeam then
local character = player.Character
if character then
player.CameraMode = "LockFirstPerson"
local kb = KillBrick:Clone()
kb.Parent = character.Head
kb.CFrame = (character.Head.CFrame + Vector3.new(0,0,-2))
kb.Orientation = Vector3.new (90,0,0)
local weld = Instance.new("WeldConstraint")
weld.Parent = character.Head
weld.Part0 = kb
weld.Part1 = character.Head
kb.IsInUse.Value = true
end
Connections[player] = player.CharacterAdded:Connect(function(character)
local kb = KillBrick:Clone()
kb.Parent = character.Head
kb.CFrame = (character.Head.CFrame + Vector3.new(0,0,2))
kb.Orientation = Vector3.new (90,0,0)
local weld = Instance.new("WeldConstraint")
kb.Name = "killerBlock"
weld.Name = "WeldThingy"
weld.Parent = character.Head
weld.Part0 = kb
weld.Part1 = character.Head
player.CameraMode = "LockFirstPerson"
kb.IsInUse.Value = true
end)
end
else
local connection = Connections[player]
if connection then
connection:Disconnect()
event.OnServerEvent:Connect(function(player)
local char = player.character
char.killerBlock:Destroy()
char.WeldThingy:Destroy()
char:GetPlayerFromCharacter().CameraMode = "Classic"
player:LoadCharacter()
end)
end
end
--//Reset the character back to normal here
end)
end)
maybe try just setting straight and always parent after setting up your properties etc
i know with welds you may have to have the part parented into the workspace first thoguh
local kb = KillBrick:Clone()
kb.CFrame = character.Head.CFrame -- maybe try the exact position and rotation by just setting the heads cframe
--kb.Orientation = Vector3.new (90,0,0)
local weld = Instance.new("WeldConstraint")
weld.Part0 = kb
weld.Part1 = character.Head
weld.Parent = character.Head
kb.Parent = character.Head -- might want to parent last if this doesn't work with the weld parent right before the weld
Also you may want to do local character = player.Character or player.CharacterAdded:Wait() since this is in a player added function to make sure the character is there
ok you probably won’t be able to change the players camera to firstperson and also you may want to use CharacterAppearanceLoaded and WaitForChild(‘Head’) to make sure the character is fully loaded if not it may auto remove the killbrick when appearance loads in the character
and also want to make sure the head has loaded in with that wait
that will make it actually add to the cframe instead if you want to move it forward or backward you would need to add the look vector times the amount of studs like below which will move it forward like in the image