The print statement is firing but the humanoid isn’t moving, even though the ‘Team’ attribute is on 1
No errors fyi
plz help
local char = script.Parent
local team = char:GetAttribute("Team")
local cframe = char.HumanoidRootPart.CFrame
local ED = char.EnemyDetector
local function ActionZero() -- For moving and stuff
if char:GetAttribute("Team") == 1 or char:GetAttribute("Team") == 3 then
print("test")
cframe += Vector3.new(0.01,0,0)
task.wait(0.01)
return
elseif char:GetAttribute("Team") == 2 or char:GetAttribute("Team") == 4 then
cframe += Vector3.new(-0.01,0,0)
task.wait(0.01)
return
else
print("lol")
task.wait(0.01)
return
end
end
local function ActionOne() -- for basic attacks
end
local function ActionTwo() -- for other abilities
end
while true do
if char:GetAttribute("ActionQued") == 0 then
ActionZero()
elseif char:GetAttribute("ActionQued") == 1 then
print("test2")
elseif char:GetAttribute("ActionQued") == 2 then
print("test3")
else
task.wait(0.01)
end
end
The only thing I can see going wrong is that you are using a server script to move the client character by a small amount. Since this amount is on server and is almost insignificant the client just rejects it and makes the character stay in place.
Adding a Vector3 to a Humanoid’s CFrame on the server usually won’t result in movement, because the Humanoid’s physics can override it. Try setting a target for the Humanoid to move to or adjust its velocity. Ran into so many I think I should add this too. I’m just going to go with this reply, most likely the main issue. I’ll PM you the book I was working on..
Ohh.. well it changes a lot but now I really don’t have an idea since I can’t really see what is happening there for my self. Based on how we improved the script I don’t see what’s wrong. I’ll come back tomorrow and if it’s still not fixed il help. Good luck!