0bby_d0g3
(Hallow_Knight)
October 16, 2023, 12:40am
#1
I’m making a game and I have an in progress lobby system. You are meant to be able to interact with a proximity prompt in order to enter and exit a lobby. This is my current code
local enterprompt = game.Workspace.Walls["lobby wall"].Enterlobby
local leaveprompt = game.Workspace.Walls["lobby wall"].Leavelobby
enterprompt.Triggered:Connect(function(Player)
Player.Character.HumanoidRootPart.Position = game.Workspace.Exit.gui.Position + Vector3.new(0,3,0)
enterprompt.Enabled = false
leaveprompt.Enabled = true
end)
leaveprompt.Triggered:Connect(function(Player)
Player.Character.HumanoidRootPart.Position = game.Workspace.leavepart.Position
enterprompt.Enabled = true
leaveprompt.Enabled = false
end)
When entering it works, when I tested leaving for the first time it worked but when I anchored the destination part it didn’t work. Also when it did work entering wouldn’t work for a second time. I don’t know why this is happening. (I’m using gui as both a ui and a destination)
0bby_d0g3
(Hallow_Knight)
October 16, 2023, 2:00am
#2
Boosing because I still need help.
0bby_d0g3
(Hallow_Knight)
October 16, 2023, 2:53am
#3
Boosing again because no one has responded
Arsik999
(Uhm)
October 16, 2023, 9:28am
#4
Try to use CFrame instead of Position So it will look like this:
local enterprompt = game.Workspace.Walls["lobby wall"].Enterlobby
local leaveprompt = game.Workspace.Walls["lobby wall"].Leavelobby
enterprompt.Triggered:Connect(function(Player)
Player.Character.HumanoidRootPart.CFrame = workspace.Exit.gui.CFrame + Vector3.new(0, 3, 0)
enterprompt.Enabled = false
leaveprompt.Enabled = true
end)
leaveprompt.Triggered:Connect(function(Player)
Player.Character.HumanoidRootPart.CFrame = game.Workspace.leavepart.CFrame
enterprompt.Enabled = true
leaveprompt.Enabled = false
end)
0bby_d0g3
(Hallow_Knight)
October 16, 2023, 8:50pm
#5
I swear I used CFrame when I first made it but it didn’t work so I used position and it worked. Now I did something to make CFrame worked. Thank you.
1 Like
system
(system)
Closed
October 30, 2023, 8:50pm
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.