I’ve been messing around with this for the past 30 minutes.
Here’s the error:
15:05:16.637 HumanoidRootPart - Server - Actions:43
15:05:16.638 nil - Server - Actions:44
15:05:16.638 ServerScriptService.Handler.Actions:47: attempt to index nil with 'WaitForChild' - Server - Actions:47
Explanation:
For some reason when i pass only Data[2] and Data[3] It Errors and Doesn’t get passed the right Data.
But when i pass all 4 bits of data, (Data[1 - 4]) it functions normally.
Why is this?!?! This is so annoying!
^ Video of the issue here.
Any help is greatly appreciated!
(if you need any more information don’t hesitate to ask! )
hum is nil. You’re not passing hum, to the dash method.
Also, passing data through remotes is restricted to certain types, afaik you can’t pass functions or objects.
Post the full function that that error occurs in, and also the function which calls that function. If the issue you’re having is indeed to do with passing a table between them, that’s what you’d need to look at.
function action:dash(rootpart, hum)
-- if rootpart and self.isRunning then
local dash = hum:LoadAnimation(hum:WaitForChild("Dash"))
dash:Play()
local dashVelocity = Instance.new("BodyVelocity")
dashVelocity.MaxForce = Vector3.new(999999,999999,999999)
dashVelocity.Parent = rootpart
task.delay(0.175, function()
dashVelocity:Destroy()
end)
--end
end
and also the function which calls that function
uis.JumpRequest:Connect(function()
event:FireServer({"Action", "dash", character:FindFirstChild("HumanoidRootPart"), hum})
print("Made the request?")
end)
You are firing the remote with one argument. Don’t forget that when sending an event from Client to Server, the Player is inserted as the first argument. Pause in your dash function and you should see that “rootpart” is actually of type player. The second argument (hum) should be a table. But since that isn’t happening, probably the call is not coming from where you expect. Pause in the dash function and check what is actually passed?
Use the </> option to post your code. I don’t even look at pictures or videos of scripts.
Make it easy for people to help you with just a simple copy I can then look over in the Studio.
Also not interested in a small section of your code when bug chasing. Need enough to fully look at the problem.