-
What do you want to achieve?
I want the model to be on the sides of you and stay on the sides of you even if you move. -
What is the issue?
I can’t find a way to make the model stay on the sides of you.
- What solutions have you tried so far?
I’ve tried making a weld but that only makes you inside of the model.
Script that puts the model on the sides of you
local fire = script.Parent.Fire
local bod = game.ReplicatedStorage:WaitForChild("BlockOfDestruction")
fire.OnServerEvent:Connect(function(player)
local char = player.Character
local root = char.HumanoidRootPart
local cod1 = bod:Clone()
cod1.Name = "cod1"
cod1.Parent = char
cod1.Main.Scripts.Rotation.Disabled = false
cod1.Main.Scripts.StayWithParent.Disabled = false
cod1:SetPrimaryPartCFrame(root.CFrame + Vector3.new(7,0,0))
local cod2 = bod:Clone()
cod2.Name = "cod2"
cod2.Parent = char
cod2.Main.Scripts.Rotation.Disabled = false
cod2.Main.Scripts.StayWithParent.Disabled = false
cod2:SetPrimaryPartCFrame(root.CFrame + Vector3.new(-7,0,0))
end)
Rotation script to make the model rotate
local model = script.Parent.Parent.Parent
for i = 0,math.huge,.005 do
wait()
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.Angles(math.rad(i),math.rad(i),math.rad(i)))
end
Script that detects if you clicked "E"
local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local fire = script:WaitForChild("Fire")
uis.InputBegan:Connect(function(input, gameprocessed)
if not gameprocessed then
if input.KeyCode == Enum.KeyCode.E then
fire:FireServer()
end
end
end)
What it looks like in ReplicatedStorage

What it looks like now