Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

Help please

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!

Jhowarth07

Member
Reputation: 0 / 0 / 0
May 2, 2021
45
7
8
Roblox
Nightfury088
I have this script here which makes players force sit when they spawn but only one player sits down and the other two spawn inside the chair and the final one spawns away from the chairs can someone please help me fix this
 

Attachments

  • 704212D0-61CE-4950-AFBE-9C802106080E.jpeg
    704212D0-61CE-4950-AFBE-9C802106080E.jpeg
    1,000.7 KB · Views: 7
  • E538E1A1-F7EA-449E-864B-881A4845127A.jpeg
    E538E1A1-F7EA-449E-864B-881A4845127A.jpeg
    1.1 MB · Views: 7

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag
Like this?

Lua:
local chairFolder = workspace.ChairFolder

local seatStatus = {
    {chair = chairFolder.chair1.Seat, taken = false},
    {chair = chairFolder.chair2.Seat, taken = false},
    {chair = chairFolder.chair3.Seat, taken = false},
    {chair = chairFolder.chair4.Seat, taken = false}
}

game.Players.PlayerAdded:Connect(function(player)
    local char = player.Character or player.CharacterAdded:wait()
   
    char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    if char.Humanoid then
        for i,v in pairs(seatStatus) do
            if v.taken == false then
                wait(0.1)
                char:MoveTo(v.chair.Position)
                char.Humanoid.Sit = true
                v.taken = true
                break
            else
               
            end
        end
    end
   
end)
 

Jhowarth07

Member
Reputation: 0 / 0 / 0
May 2, 2021
45
7
8
Roblox
Nightfury088
If you need lots of help alot of the time i recommend going into the devforum they respond insanely fast and help, I'm banned on the devforum for being homophobic so yah
Can’t post in the dev forum yet so I’m using this for now
Post automatically merged:

I
Like this?

Lua:
local chairFolder = workspace.ChairFolder

local seatStatus = {
    {chair = chairFolder.chair1.Seat, taken = false},
    {chair = chairFolder.chair2.Seat, taken = false},
    {chair = chairFolder.chair3.Seat, taken = false},
    {chair = chairFolder.chair4.Seat, taken = false}
}

game.Players.PlayerAdded:Connect(function(player)
    local char = player.Character or player.CharacterAdded:wait()
  
    char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    if char.Humanoid then
        for i,v in pairs(seatStatus) do
            if v.taken == false then
                wait(0.1)
                char:MoveTo(v.chair.Position)
                char.Humanoid.Sit = true
                v.taken = true
                break
            else
              
            end
        end
    end
  
end)
Ill give this a go thank you
Post automatically merged:

If you need lots of help alot of the time i recommend going into the devforum they respond insanely fast and help, I'm banned on the devforum for being homophobic so yah
Can’t post in the dev forum yet so I’m using this for now
Post automatically merged:

I
Like this?

Lua:
local chairFolder = workspace.ChairFolder

local seatStatus = {
    {chair = chairFolder.chair1.Seat, taken = false},
    {chair = chairFolder.chair2.Seat, taken = false},
    {chair = chairFolder.chair3.Seat, taken = false},
    {chair = chairFolder.chair4.Seat, taken = false}
}

game.Players.PlayerAdded:Connect(function(player)
    local char = player.Character or player.CharacterAdded:wait()
 
    char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    if char.Humanoid then
        for i,v in pairs(seatStatus) do
            if v.taken == false then
                wait(0.1)
                char:MoveTo(v.chair.Position)
                char.Humanoid.Sit = true
                v.taken = true
                break
            else
             
            end
        end
    end
 
end)
Ill give this a go thank you
Like this?

Lua:
local chairFolder = workspace.ChairFolder

local seatStatus = {
    {chair = chairFolder.chair1.Seat, taken = false},
    {chair = chairFolder.chair2.Seat, taken = false},
    {chair = chairFolder.chair3.Seat, taken = false},
    {chair = chairFolder.chair4.Seat, taken = false}
}

game.Players.PlayerAdded:Connect(function(player)
    local char = player.Character or player.CharacterAdded:wait()
  
    char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    if char.Humanoid then
        for i,v in pairs(seatStatus) do
            if v.taken == false then
                wait(0.1)
                char:MoveTo(v.chair.Position)
                char.Humanoid.Sit = true
                v.taken = true
                break
            else
              
            end
        end
    end
  
end)
I have used your code it works better but then they still spawn inside the chair and they are all facing left of the chair
 
Last edited:
  • Like
Reactions: kaabzuag

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag
Check if your seat is turning the right position. Players sit facing front. You can put a blank decal into the seat and set it to Front, then you can see where the front surface of the seat is. Rotate it to the right direction and delete the decal.
 

Jhowarth07

Member
Reputation: 0 / 0 / 0
May 2, 2021
45
7
8
Roblox
Nightfury088
Check if your seat is turning the right position. Players sit facing front. You can put a blank decal into the seat and set it to Front, then you can see where the front surface of the seat is. Rotate it to the right direction and delete the decal.
What about them spawning inside the chairs ?
Post automatically merged:

Check if your seat is turning the right position. Players sit facing front. You can put a blank decal into the seat and set it to Front, then you can see where the front surface of the seat is. Rotate it to the right direction and delete the decal.
I have added decals and there all facing the right direction
 

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag
Check if your seat is turning the right position. Players sit facing front. You can put a blank decal into the seat and set it to Front, then you can see where the front surface of the seat is. Rotate it to the right direction and delete the decal.
I have added decals and there all facing the right direction
Okay, check the front surface of the chair, too. Since the character is to move to the chair's position before sitting down.
 

Jhowarth07

Member
Reputation: 0 / 0 / 0
May 2, 2021
45
7
8
Roblox
Nightfury088
Check if your seat is turning the right position. Players sit facing front. You can put a blank decal into the seat and set it to Front, then you can see where the front surface of the seat is. Rotate it to the right direction and delete the decal.
I have added decals and there all facing the right direction
Okay, check the front surface of the chair, too. Since the character is to move to the chair's position before sitting down.
Done that I tried it with an already made chair too and have the same problem is there any other ways to do it
 

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag
Try this:

char.HumanoidRootPart.CFrame = v.chair.CFrame + Vector3.new(0,1,0)
They all spawn the right way now it’s just the problem of them spawning inside the chair instead of spawning sitting
Since you are having them move to the seat before forcing Humanoid.Sit = true, if your Seat Transparency is set to 1 (invisible) then just move it up a little bit so the player will sit up higher.
 

Jhowarth07

Member
Reputation: 0 / 0 / 0
May 2, 2021
45
7
8
Roblox
Nightfury088
now this happens image.jpg
Post automatically merged:

Try this:

char.HumanoidRootPart.CFrame = v.chair.CFrame + Vector3.new(0,1,0)
They all spawn the right way now it’s just the problem of them spawning inside the chair instead of spawning sitting
Since you are having them move to the seat before forcing Humanoid.Sit = true, if your Seat Transparency is set to 1 (invisible) then just move it up a little bit so the player will sit up higher.
That didn’t work either
 
Last edited:

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag
1623426468216.png 1623426891227.png
The semi-transparent part is the Seat part.
Lua:
--char.HumanoidRootPart.CFrame = v.chair.CFrame + Vector3.new(0,1,0) -- take away this and change back to the char:MoveTo()
char:MoveTo(v.chair.Position + Vector3.new(0,7,0)) --Add that when player spawns, it spawns up above the seat's position so when it falls down to touch the seat, it will automatically sit. You can play around the number to make it meet your game's needs. Vector.new(0,number,0)
--char.Humanoid.Sit = true -- take away this. I think is making the player bounce off the seat.
 

kaabzuag

Ultra
Reputation: 3 / 0 / 0
May 11, 2021
97
10
75
18
34
Roblox
kaabzuag
do you have a pic of the script ?
Same, but just change the ones I mentioned above.
Lua:
local chairFolder = workspace.ChairFolder

local seatStatus = {
    {chair = chairFolder.chair1.Seat, taken = false},
    {chair = chairFolder.chair2.Seat, taken = false},
    {chair = chairFolder.chair3.Seat, taken = false},
    {chair = chairFolder.chair4.Seat, taken = false}
}

game.Players.PlayerAdded:Connect(function(player)
    local char = player.Character or player.CharacterAdded:wait()

    char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    if char.Humanoid then
        for i,v in pairs(seatStatus) do
            if v.taken == false then
                wait(0.1)
                char:MoveTo(v.chair.Position + Vector3.new(0,7,0))
                v.taken = true
                break
            else

            end
        end
    end

end)
 
  • Like
Reactions: FarmCacti