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

I want group memebrs to spawn in a location. But the script aint woking pls help?

Asked by 3 years ago
local id = 5174732
game.Players.PlayerAdded:Connect(function(Plr)
    if Plr:IsInGroup(id) then
        Plr.CharacterAdded:Connect(function(character)
            character.UpperTorso.Position = Vector3.new(-2658.687, 7.604, 19.582)
        end)
    end 
end)

1 answer

Log in to vote
0
Answered by 3 years ago

You should use HumanoidRootPart instead since its a root part of a model character. And here is a better code:

local id = 5174732
game.Players.PlayerAdded:Connect(function(Plr)
    if Plr:IsInGroup(id) then
        repeat wait(1) until Plr.Character
        Plr.Character.HumanoidRootPart.Position = Vector3.new(-2658.687, 7.604, 19.582)
    end 
end)
0
i have this error 03:22:57.404 - user_Group-Based-Auto-Team-Script.rbxm.Group-Based Auto-Team Script:12: attempt to index nil with 'GetRankInGroup' Just_T0m 1 — 3y
Ad

Answer this question