Hello, I’m getting some problems when I try to get the player from a server script after firing an event.
local event = game.ReplicatedStorage:WaitForChild("Push")
local plr = game.Players.LocalPlayer
event.OnServerEvent:Connect(function(input, V1)
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
if hum then
print("Hum")
end
end)
This is what I have done so far, it’s not alot but it’s just a test so I know how to get the player after using parameters on the function. As you can see, after I fire the event I’ve got 2 parameters: “Input”, which is the name of the function and “V1”, which is the variable I want to keep from the local script.
It all works correctly but when I try to get the character this is the error that shows up: ServerScriptService.Push:5: attempt to index nil with ‘Character’
I have trying making the player part of the parameters and it does work but then it breaks the other variables.
In case I haven’t been clear I’ll try to answer your questions.
Thank you!