idk y it doesn't work, so pls help. me new to lua

Script :

local remote = game:GetService("ReplicatedStorage"):WaitForChild("Menu")

remote.OnServerEvent:Connect(function(Player, Value1, Value2)
	local data = Player:WaitForChild("Data")
	if Value1 == "Menu" then
		if data:WaitForChild("HasGame").Value == false then
			remote:FireClient(Player, "OpenEditor")
			character.HumanoidRootPart.CFrame = workspace:WaitForChild("CharacterCreateSpawn").CFrame
		else -- tp onto game lol
			
		end
	end
end)

Output: ServerScriptService.Menu:8: attempt to index nil with 'HumanoidRootPart'

Also, I'm new to this website.

6 comments

0

Where did you get the character from tho?

0

w0rkspace

0

Idk, where it lead to. I used free model lol

0

OMGOMGOMGOMG THX

0

Maybe learn scripting then? If you just copy-paste things from random free models without understanding what anything does or comes from, you're not exactly doing much.

0

Ur going to copy paste first & Learn from it. Then u can make one from ur self