TbeyazT
(TbeyazT)
May 9, 2023, 7:42pm
#1
i just got error and could not fix it
here script:
EventsFolder.gloryKillPos.OnServerEvent:Connect(function(plr,Target)
local char = plr.Character or plr.CharacterAdded:Wait()
local hrpChar = char:WaitForChild("HumanoidRootPart")
local hrpTarget = Target:WaitForChild("HumanoidRootPart")
local targethum = Target:WaitForChild("Humanoid")
Target:WaitForChild("Humanoid").WalkSpeed = 0
local gkVictim = Target:WaitForChild("Humanoid"):LoadAnimation(Tool:WaitForChild("AnimsFolder"):WaitForChild("GkVictim"))
gkVictim:Play()
hrpTarget.Anchored = true
hrpChar.Anchored = true
hrpTarget.CFrame = hrpChar.CFrame.lookVector * CFrame.new(0,0,-2)
wait(0.9)
Tool:WaitForChild("FistPoints").Hit1:Play()
targethum:TakeDamage(5)
wait(0.18)
Tool:WaitForChild("FistPoints").Hit2:Play()
targethum:TakeDamage(5)
wait(0.33)
hrpChar.Anchored = false
Tool:WaitForChild("FistPoints").Hit3:Play()
targethum:TakeDamage(targethum.MaxHealth)
end)
what error i got:
Players.voicesinmyming.Backpack.Fists.Server:520: invalid argument #1 (CFrame expected, got Vector3)
where error located:
hrpTarget.CFrame = hrpChar.CFrame.lookVector * CFrame.new(0,0,-2)
Auxicon
(Auxicon)
May 9, 2023, 7:48pm
#2
Can you try
hrpTarget.CFrame = hrpChar.CFrame.lookVector * Vector3.new(0,0,-2)
TbeyazT
(TbeyazT)
May 9, 2023, 8:03pm
#3
Unable to assign property CFrame. CoordinateFrame expected, got Vector3 -
Perhaps you meant to add?
hrpTarget.CFrame = hrpChar.CFrame.lookVector + CFrame.new(0,0,-2)
Or convert a Vector3 into a CFrame?
hrpTarget.CFrame = CFrame.new(hrpChar.CFrame.lookVector * Vector3.new(0,0,-2))
1 Like
TbeyazT
(TbeyazT)
May 9, 2023, 8:10pm
#5
this works
omega:
Or convert a Vector3 into a CFrame?
hrpTarget.CFrame = CFrame.new(hrpChar.CFrame.lookVector * Vector3.new(0,0,-2))
but its looking like this now
Do this instead
--moves the target humanoidrootpart 2 studs in front of the character’s hrp
hrpTarget.CFrame = hrpChar.CFrame:PointToWorldSpace(Vector3.new(0, 0, -2))
you might also want to do something with the humanoidrootpart or the humanoid so that the character doesn’t get flung.
1 Like
TbeyazT
(TbeyazT)
May 11, 2023, 11:11am
#7
it not works it says same error
Change to:
hrpTarget.CFrame = hrpChar.CFrame + (hrpChar.LookVector * 2)
2 Likes
TbeyazT
(TbeyazT)
May 11, 2023, 11:58am
#9
LookVector is not a valid member of Part “Workspace.chars.TbeyazT.HumanoidRootPart”
Yes, a simple typo. Have you tried fixing it yourself? You should know that LookVector
is a property of CFrames. What do you think I was trying to do?
hrpTarget.CFrame = hrpChar.CFrame + (hrpChar.CFrame.LookVector * 2)
try this
hrpTarget.CFrame = CFrame.new(0,0,0,hrpChar.CFrame.lookVector.LookVector.X,hrpChar.CFrame.lookVector.Y,hrpChar.CFrame.lookVector.LookVector.Z * -2)
Instead of
hrpTarget.CFrame = hrpChar.CFrame.lookVector * CFrame.new(0,0,-2)
Try this
hrpTargetCFrame = hrpChar.CFrame + hrpChar.CFrame.LookVector * 2
1 Like
TbeyazT
(TbeyazT)
May 11, 2023, 2:25pm
#13
i tried everymethod i know but not worked
TbeyazT
(TbeyazT)
May 11, 2023, 2:37pm
#14
BROOO THANK YOU SO MUCH i am soo bad how did i not see this
I sent you that exact code already.
What makes his better? Did you not understand mine, but understood his? I would ask if you saw it, but you did.
It’s the same, but mine was 3 hours before.
I predicted this would happen, it’s just how the devforum is.
TbeyazT
(TbeyazT)
May 11, 2023, 3:08pm
#16
i am sorry about that my guy ok i fixing it
system
(system)
Closed
May 25, 2023, 3:09pm
#17
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.