Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you clone a union and make it so that it faces the correct direction?

Asked by 5 years ago

Code:

script.Parent.direF.OnServerEvent:Connect(function(p, mouse)
local plr = p
local char = plr.Character or plr.CharacterAdded:wait()
local hum = char.Humanoid
script.Parent.Parent.Parent.Data.Tries.Value = script.Parent.Parent.Parent.Data.Tries.Value + 50
script.Parent.Parent.Parent.Data.LeftMaina.Value = script.Parent.Parent.Parent.Data.LeftMaina.Value - 40
local AlreadyTouched = false
local trident = game.ReplicatedStorage.Trident:Clone()
trident.Parent = char
trident.BrickColor = BrickColor.new("Bright blue")
trident.Material = Enum.Material.Neon
trident.Anchored = true
trident.CanCollide = false


while true do
    wait()
    trident.CFrame = char.Head.CFrame*CFrame.new(0,2.5,0)
end
end)

I tried to clone a spear I had made and stored in ReplicatedStorage. It worked, yes but the problem is the pointy part of the spear is facing opposite the front of the character. How do I correct the orientation of the spear? And one more thing, how do I make the pointy part follow my mouse?

Answer this question