✓ Accepted answer
If all you're trying to do is get the HumanoidRootPart from the player's Character then you can use a local script for this then use a RemoteEvent to fire the server from the localscript and use a server script to do the rest of the code if you want anything to be server sided. Example:
Local Script:
local player = game.Players.LocalPlayer
local character = player.Character
local Hum = character.HumanoidRootPart
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
RemoteEvent:FireServer()
Server Script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
local character = player.Character
local Hum = character.HumanoidRootPart
end)
5 comments
Could you please explain what this is for? Why does this need to be in a Server Script?
It's in a regular script not in the server.
Yes, regular script, server script, same thing. I believe Server Script would be the proper term for it tho, anyway. I need some context, what is this for?
Look at the title...
Players.6zk8.PlayerGui.ScreenGui.TextLabel.Script:3: attempt to index nil with 'HumanoidRootPart' <<< That's the error