Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I keep getting an error "Character is not a valid member of Part" what is wrong?

local RE = game.ReplicatedStorage:WaitForChild("TPBack") local player = game.Players.LocalPlayer

RE.OnClientEvent:Connect(function(player,pos) player.Character.HumanoidRootPart.CFrame = pos.CFrame + Vector3.new(0,3,0) end)

1 comment

0

you shouldnt define player because it is already defined on the on client event. also what is being received from the on client seems to be a part not a player object

1 answer

What is parameter one? You have conflicting variable names since player on your second line is has the same name as player in the function. If you are passing another player which is not the localplayer in the function, make sure that is a player object.

If you are changing the localplayers Humanoid Root Part, then change the name of the player variable on line two to something like LocalPlayer and change the line inside the function to LocalPlayer.Character.HumanoidRootPart.CFrame = pos.CFrame + Vector3.new(0,3,0)

visual of what's happening bc im bad at explaining

This discussion is preserved as it was. New answers, comments, and votes are closed.