Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ServerScriptService attempt to index nil with 'HumanoidRootPart' How do i fix it? [Solved]

Asked by 4 years ago
Edited by DeceptiveCaster 4 years ago

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.

0
Where did you get the character from tho? buoyantair 123 — 4y
0
w0rkspace SpotTicker 15 — 4y
0
Idk, where it lead to. I used free model lol SpotTicker 15 — 4y
0
OMGOMGOMGOMG THX SpotTicker 15 — 4y
View all comments (2 more)
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. Codename_Texas 27 — 4y
0
Ur going to copy paste first & Learn from it. Then u can make one from ur self SpotTicker 15 — 4y

Answer this question