After line 8 in the OnPlayerAdded script I forgot to add this line of code: activelyPlaying.Parent = valuesFolder If you need help getting your elevator game to work, or you wanna join my community I have a discord server. discord.gg/RRMurrCaUy
Sorry but i am having another issue When i try to walk into the elevator it just doesnt go it my script looks like this local Elevator = script.Parent.Parent.Parent local ElevatorTeleportPart = workspace.Elevator.TeleportPart local EntryTouchPart = script.Parent local TeleportParts = { Elevator.WaitingParts.WaitingPart1, Elevator.WaitingParts.WaitingPart2, Elevator.WaitingParts.WaitingPart3, Elevator.WaitingParts.WaitingPart4, Elevator.WaitingParts.WaitingPart5, Elevator.WaitingParts.WaitingPart6, } local ElevatorEmpty = true local ElevatorOpen = true local CountdownTime = 6 local MainDoor = Elevator.Door.MainDoor local Door1 = Elevator.Door.RightDoor local Door2 = Elevator.Door.LeftDoor local TweenService = game:GetService("TweenService") local InitialPosition1 = Door1.Position local InitialPosition2 = Door2.Position local TargetPosition1 = InitialPosition1 + Vector3.new(0,0, -3.2) local TargetPosition2 = InitialPosition2 - Vector3.new(0,0, -3.2) local Duration = 3.3 local EasingStyle = Enum.EasingStyle.Sine local EasingDirection = Enum.EasingDirection.Out local Tween1 = TweenService:Create( Door1, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = TargetPosition1} ) local Tween2 = TweenService:Create( Door2, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = TargetPosition2} ) local TweenBack1 = TweenService:Create( Door1, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = InitialPosition1} ) local TweenBack2 = TweenService:Create( Door2, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = InitialPosition2} ) local function TeleportToTeleportPart(player) for _, part in ipairs(TeleportParts) do local occupied = part:FindFirstChild("Occupied") if not occupied then local playerName = Instance.new("StringValue") playerName.Name = "PlayerName" playerName.Value = player.Name playerName.Parent = part
local isOccupied = Instance.new("BoolValue") isOccupied.Name = "Occupied" isOccupied.Value = true isOccupied.Parent = part
local humanoid = player.Character and player.Character:FindFirstChild("Humanoid") if humanoid then player.Character:SetPrimaryPartCFrame(part.CFrame) end
return true end end return false end local function CountdownAndTeleport() local CountdownText1 = script.Parent.Timer.TimerFront.Frame.TextLabel local CountdownText2 = script.Parent.Timer.TimerBack.Frame.TextLabel
for sec = CountdownTime, 0, -1 do CountdownText1.Text = tostring(sec) CountdownText2.Text = tostring(sec) wait(1) end ElevatorOpen = false TweenBack1:Play() TweenBack2:Play() CountdownText1.Text = "" CountdownText2.Text = "" wait(3.6)
for _, part in ipairs(TeleportParts) do local playerName = part:FindFirstChild("PlayerName") local isOccupied = part:FindFirstChild("Occupied")
if playerName and isOccupied and isOccupied.Value then local player = game.Players:FindFirstChild(playerName.Value)
if player then local Humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
if Humanoid then player.Character:SetPrimaryPartCFrame(ElevatorTeleportPart.CFrame) player.ValuesFolder.ActivelyPlaying.Value = true playerName:Destroy() isOccupied:Destroy() Humanoid.Walkspeed = 16 Humanoid.JumpHeight = 7.2 end end end end wait(2) Tween1:Play() Tween2:Play() wait(3.5) ElevatorOpen = true ElevatorEmpty = true end local TouchCooldown = false EntryTouchPart.Touched:Connect(function(hit) if TouchCooldown or not ElevatorOpen then return end TouchCooldown = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player and hit.Parent:FindFirstChild("Humanoid") then local teleported = TeleportToTeleportPart(player) if teleported then hit.Parent.Humanoid.WalkSpeed = 0 hit.Parent.Humanoid.JumpHeight = 0
if ElevatorEmpty then ElevatorEmpty = false coroutine.wrap(CountdownAndTeleport)() end end end
Will you do a money that you can get for participating in a round (like 10 or 15) and a shop in where you can buy a sword (not killing sword), speed coil and jump coil? (These were just some ideas)
This was a great tutorial! I only had one issue with it, for some reason my songs do shuffle but my floors sadly do not, it says that waitlist is an unknown global. One suggestion I have for this series is making a tutorial for how to give players the currencies, "Floors" (number of floors the player has done,) and "Coins" (amount of coins from one floor), and saving these stats.
Did you define the wait list table variable? like this: local waitlist= {} If you did, maybe it isn't put in the correct spot in the script. It might need to be defined earlier or later on in the script
instead of making a function for each floor, you can make a folder called like "mapcode" or whatever in the floor folder and put a modulescript in there, then run the code in the modulescript when the floor is loaded
Hey I dont know why but When i test out the teleporting mechanic it always says : 393 ActivelyPlaying is not a valid member of Folder "Players.Purpledroid11.ValuesFolder" - Server - Elevator Script:75 my elevator script look like this: -- VARIABLES -- local MainInfo = game.ServerStorage:WaitForChild("Info") local CurrentFloor = MainInfo.CurrentFloor.Value local ServerFloorCount = MainInfo.ServerFloorCount.Value local Elevator = game.Workspace:WaitForChild("Elevator") local MainDoor = Elevator.Door.MainDoor local Door1 = Elevator.Door.RightDoor local Door2 = Elevator.Door.LeftDoor local TweenService = game:GetService("TweenService") local InitialPosition1 = Door1.Position local InitialPosition2 = Door2.Position local TargetPosition1 = InitialPosition1 + Vector3.new(0,0, -3.2) local TargetPosition2 = InitialPosition2 - Vector3.new(0,0, -3.2) local Duration = 3.3 local EasingStyle = Enum.EasingStyle.Sine local EasingDirection = Enum.EasingDirection.Out local Tween1 = TweenService:Create( Door1, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = TargetPosition1} ) local Tween2 = TweenService:Create( Door2, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = TargetPosition2} ) local TweenBack1 = TweenService:Create( Door1, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = InitialPosition1} ) local TweenBack2 = TweenService:Create( Door2, TweenInfo.new(Duration, EasingStyle, EasingDirection), {Position = InitialPosition2} ) local Playlist = Elevator.SoundPart:GetChildren() local MusicWaitlist = {} for _, music in ipairs(Playlist) do table.insert(MusicWaitlist, music) end local function chooseMusic() local music = table.remove(MusicWaitlist, 1) table.insert(MusicWaitlist, music) return music end local function shufflePlaylist() for i = #MusicWaitlist, 2, -1 do local j = math.random(i) MusicWaitlist[i], MusicWaitlist[j] = MusicWaitlist[j], MusicWaitlist[i] end end shufflePlaylist() local function shuffleWaitlist() for i = #waitlist, 2, -1 do local j = math.random(i) waitlist[i], waitlist[j] = waitlist[j], waitlist[i] end end local TeleportPart = Elevator.TeleportPart local function TeleportBackToElevator() for _, player in ipairs(game.Players:GetPlayers()) do if player:FindFirstChild("ValuesFolder").ActivelyPlaying.Value == true then if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then local CharacterPosition = player.Character.HumanoidRootPart.Position
if (CharacterPosition - TeleportPart.Position).Magnitude > 9 then player.Character:SetPrimaryPartCFrame(CFrame.new(TeleportPart.Position)) end end end end end --VALUES- floors = {"OBBYEND", "MINEFIELD", "Floodescape", "Gamerroom", "Run"} CountDownTime = 25 items = {} waitlist = {} -- FLOOR SCRIPTS -- local function FloorOBBYEND() local floor = game.Workspace:WaitForChild("OBBYEND")
MainDoor.CanCollide = false
wait(30)
wait(30) TeleportBackToElevator() end local function FloorMINEFIELD() local floor = game.Workspace:WaitForChild("MINEFIELD") MainDoor.CanCollide = false wait(30) wait(30) TeleportBackToElevator() end local function FloorFloodescape() local floor = game.Workspace:WaitForChild("Floodescape") MainDoor.CanCollide = false wait(30) wait(30) TeleportBackToElevator() end local function FloorGamerroom() local floor = game.Workspace:WaitForChild("Gamerroom") MainDoor.CanCollide = false wait(30) wait(30) TeleportBackToElevator() end local function FloorRun() local floor = game.Workspace:WaitForChild("Run") MainDoor.CanCollide = false wait(30) wait(30) TeleportBackToElevator() end -- ELEVATOR SYSTEM-- for i=1,#floors do local item = game.ServerStorage.Floors:FindFirstChild(floors[i]) if item ~= nil then item.Parent = nil table.insert(items, item) table.insert(waitlist, item) else print("Error:", floors[i], "was not found.") end end function ChooseFloor() local NewFloor = table.remove(waitlist, 1) table.insert(waitlist, NewFloor) CurrentFloor = NewFloor return NewFloor end shuffleWaitlist() shufflePlaylist() while true do local Map = ChooseFloor():Clone() local music = chooseMusic() music:Play()
wait(CountDownTime)
music:Stop()
Map.Parent = game.Workspace ServerFloorCount +=1
MainDoor.Bell:Play()
wait(0.5)
MainDoor.Open:Play() Tween1:Play() Tween2:Play()
if CurrentFloor.Name == "OBBYEND" then FloorOBBYEND() elseif CurrentFloor.Name == "MINEFIELD" then FloorMINEFIELD() elseif CurrentFloor.Name == "Floodescape" then FloorFloodescape() elseif CurrentFloor.Name == "Gamerroom" then FloorGamerroom() elseif CurrentFloor.Name == "Run" then FloorRun() end
end and my onplayer add looks like this: game.Players.PlayerAdded:Connect(function(player) local valuesFolder = Instance.new("Folder") valuesFolder.Name = "ValuesFolder" valuesFolder.Parent = player
@@noobie425 I just now noticed that I forgot to add a line of code in the video which has been causing that error so I just put the fix in the pinned comment
appreciate the video, I'm pretty much following the same thing, with different models and it all works perfectly better then what I tried to make before. Just a few questions, before this video I made a song system where I reference the part containing all the song ids then use GetChildren on it. After I just use math.random to randomly pick and play a song. I tried your method and it works perfectly fine as well, though I don't exactly understand the table syntax and stuff. In your opinion is it better to use the latter or is the former alright? I don't know if you already done these things but maybe a shop system, leaderboard system (how to make them and save them), changing lighting or camera would be really helpful. Like some floors, my idea is to make it scary, and changing the lighting would be good. And for camera work, it would be cool to make some floors have some sort of cut scene at the beginning. I personally think the long videos are good, I like seeing your workflow and process. It's very insightful as someone starting to code on studio. Anyways cheers boss.
For the song system I did plan on using math.random but I felt like using this shuffle mechanism because it puts all of the songs in an organized queue line and also prevents the same song from getting picked twice in a row In the next part I do plan on adding a shop, leaderboard (With datastorage), and lighting changes. I'll try and see if I can do anything for camera effects
good tutorial but theres one issue: sometimes this "ServerScriptService.Elevator:117: attempt to index nil with 'Clone'" error will pop up and it will stop the script from working. how do i fix that?
This tutorial is really helpful so I can make my game but I’m experiencing a problem. After adding the new code onto the script (the part where the SoundPart plays music and stops), the elevator just doesn’t open anymore. If I use the script from Part 1, it still opens.
That means there's an error, you'll have to see what shows up in the output when you test your game. It should be in red text The output button is in the view tab
@@unionedspiderah ok I see. It says that SoundPart is not a valid member of Folder “Workspace.Elevator”. I assume I need to put the SoundPart inside the Elevator folder? Edit: nvm I got it to work. The problem was that the objects like SoundPart and Teleport Pad weren’t in the elevator folder. I appreciate the help
@@unionedspider oh thanks, I only do the 1 part but to be honest, the tutorial see really good and complex, and I hope that you upload the 3rd part, have a nice day :3
If you make a part 4 you should make it so on some floors it will kick the player out the elevator and make them participate in the game instead of camping the elevator
I don't understand Where did you get the" ElevatorOpen = false" it tells me that it's a mistake What should I do????????????????????????????????????????????????????????????????
i am not sure if my previous comment got marked as spam or something but i was having trouble with getting the queue elevator to work, and im not sure what i did wrong. do you have any ideas about that? (nice video btw)
theres probably more information from my "held-for-review" comment but maybe because i sent links youtube took it down (they were just google drive links with screenshots, btw)
@@thenyancatcookie For some reason the comment doesn't show up in the "Held for review" area but if you want you can try sending the links again and I'll recheck the comments held for review
@@unionedspider i sent like three comments, and they were all suddenly deleted off of yt :skull: i guess it's something to do with sending links in a comment section
Great video but i got an error and i have no idea what it means --> ActivelyPlaying is not a valid member of Folder "Players.abbeXDhjalmar16.ValuesFolder"
can you give me game link and make it uncoppylocked for people that having trouble with and thank you for reading this Here my username :D -Dinokingplez
After line 8 in the OnPlayerAdded script I forgot to add this line of code:
activelyPlaying.Parent = valuesFolder
If you need help getting your elevator game to work, or you wanna join my community I have a discord server.
discord.gg/RRMurrCaUy
This is a great tutorial and is helping me make my game. Hope you continue this series.
this is actually such a goated tutorial dude keep making more
Thank you for making this tutorial! It's very helpful! :D
Sorry but i am having another issue When i try to walk into the elevator it just doesnt go it my script looks like this
local Elevator = script.Parent.Parent.Parent
local ElevatorTeleportPart = workspace.Elevator.TeleportPart
local EntryTouchPart = script.Parent
local TeleportParts = {
Elevator.WaitingParts.WaitingPart1,
Elevator.WaitingParts.WaitingPart2,
Elevator.WaitingParts.WaitingPart3,
Elevator.WaitingParts.WaitingPart4,
Elevator.WaitingParts.WaitingPart5,
Elevator.WaitingParts.WaitingPart6,
}
local ElevatorEmpty = true
local ElevatorOpen = true
local CountdownTime = 6
local MainDoor = Elevator.Door.MainDoor
local Door1 = Elevator.Door.RightDoor
local Door2 = Elevator.Door.LeftDoor
local TweenService = game:GetService("TweenService")
local InitialPosition1 = Door1.Position
local InitialPosition2 = Door2.Position
local TargetPosition1 = InitialPosition1 + Vector3.new(0,0, -3.2)
local TargetPosition2 = InitialPosition2 - Vector3.new(0,0, -3.2)
local Duration = 3.3
local EasingStyle = Enum.EasingStyle.Sine
local EasingDirection = Enum.EasingDirection.Out
local Tween1 = TweenService:Create(
Door1,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = TargetPosition1}
)
local Tween2 = TweenService:Create(
Door2,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = TargetPosition2}
)
local TweenBack1 = TweenService:Create(
Door1,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = InitialPosition1}
)
local TweenBack2 = TweenService:Create(
Door2,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = InitialPosition2}
)
local function TeleportToTeleportPart(player)
for _, part in ipairs(TeleportParts) do
local occupied = part:FindFirstChild("Occupied")
if not occupied then
local playerName = Instance.new("StringValue")
playerName.Name = "PlayerName"
playerName.Value = player.Name
playerName.Parent = part
local isOccupied = Instance.new("BoolValue")
isOccupied.Name = "Occupied"
isOccupied.Value = true
isOccupied.Parent = part
local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
if humanoid then
player.Character:SetPrimaryPartCFrame(part.CFrame)
end
return true
end
end
return false
end
local function CountdownAndTeleport()
local CountdownText1 = script.Parent.Timer.TimerFront.Frame.TextLabel
local CountdownText2 = script.Parent.Timer.TimerBack.Frame.TextLabel
for sec = CountdownTime, 0, -1 do
CountdownText1.Text = tostring(sec)
CountdownText2.Text = tostring(sec)
wait(1)
end
ElevatorOpen = false
TweenBack1:Play()
TweenBack2:Play()
CountdownText1.Text = ""
CountdownText2.Text = ""
wait(3.6)
for _, part in ipairs(TeleportParts) do
local playerName = part:FindFirstChild("PlayerName")
local isOccupied = part:FindFirstChild("Occupied")
if playerName and isOccupied and isOccupied.Value then
local player = game.Players:FindFirstChild(playerName.Value)
if player then
local Humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
if Humanoid then
player.Character:SetPrimaryPartCFrame(ElevatorTeleportPart.CFrame)
player.ValuesFolder.ActivelyPlaying.Value = true
playerName:Destroy()
isOccupied:Destroy()
Humanoid.Walkspeed = 16
Humanoid.JumpHeight = 7.2
end
end
end
end
wait(2)
Tween1:Play()
Tween2:Play()
wait(3.5)
ElevatorOpen = true
ElevatorEmpty = true
end
local TouchCooldown = false
EntryTouchPart.Touched:Connect(function(hit)
if TouchCooldown or not ElevatorOpen then
return
end
TouchCooldown = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and hit.Parent:FindFirstChild("Humanoid") then
local teleported = TeleportToTeleportPart(player)
if teleported then
hit.Parent.Humanoid.WalkSpeed = 0
hit.Parent.Humanoid.JumpHeight = 0
if ElevatorEmpty then
ElevatorEmpty = false
coroutine.wrap(CountdownAndTeleport)()
end
end
end
wait(1)
TouchCooldown = false
end)
Tween1:Play()
Tween2:Play()
this silly thing is you have to turn on can touch in the queue elevator main door part
@G1rlPl3asBEE Thanks!
Tutorial is great but i've got one question how do i make so floors wasn't same 2 or more times in a row?
@@SFKJSC The code in this video fixes that
Will you do a money that you can get for participating in a round (like 10 or 15) and a shop in where you can buy a sword (not killing sword), speed coil and jump coil? (These were just some ideas)
@@Pebble_DandyJunior Yeah
Nice @@unionedspider
This was a great tutorial! I only had one issue with it, for some reason my songs do shuffle but my floors sadly do not, it says that waitlist is an unknown global. One suggestion I have for this series is making a tutorial for how to give players the currencies, "Floors" (number of floors the player has done,) and "Coins" (amount of coins from one floor), and saving these stats.
Did you define the wait list table variable?
like this:
local waitlist= {}
If you did, maybe it isn't put in the correct spot in the script. It might need to be defined earlier or later on in the script
@@unionedspiderthanks, it worked!
Thank you! This was so helpful!!, kind of a weird request but do you know how to make a npc join the elevator?
Yeah I'll do that in the next part
@@unionedspider tysm ❣️❣️❣️❣️
instead of making a function for each floor, you can make a folder called like "mapcode" or whatever in the floor folder and put a modulescript in there, then run the code in the modulescript when the floor is loaded
@@burlytech Yeah good point I plan to do this in the next tutorial I upload
@@unionedspider 👍alright
Hey I dont know why but When i test out the teleporting mechanic it always says :
393 ActivelyPlaying is not a valid member of Folder "Players.Purpledroid11.ValuesFolder" - Server - Elevator Script:75 my elevator script look like this:
-- VARIABLES --
local MainInfo = game.ServerStorage:WaitForChild("Info")
local CurrentFloor = MainInfo.CurrentFloor.Value
local ServerFloorCount = MainInfo.ServerFloorCount.Value
local Elevator = game.Workspace:WaitForChild("Elevator")
local MainDoor = Elevator.Door.MainDoor
local Door1 = Elevator.Door.RightDoor
local Door2 = Elevator.Door.LeftDoor
local TweenService = game:GetService("TweenService")
local InitialPosition1 = Door1.Position
local InitialPosition2 = Door2.Position
local TargetPosition1 = InitialPosition1 + Vector3.new(0,0, -3.2)
local TargetPosition2 = InitialPosition2 - Vector3.new(0,0, -3.2)
local Duration = 3.3
local EasingStyle = Enum.EasingStyle.Sine
local EasingDirection = Enum.EasingDirection.Out
local Tween1 = TweenService:Create(
Door1,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = TargetPosition1}
)
local Tween2 = TweenService:Create(
Door2,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = TargetPosition2}
)
local TweenBack1 = TweenService:Create(
Door1,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = InitialPosition1}
)
local TweenBack2 = TweenService:Create(
Door2,
TweenInfo.new(Duration, EasingStyle, EasingDirection),
{Position = InitialPosition2}
)
local Playlist = Elevator.SoundPart:GetChildren()
local MusicWaitlist = {}
for _, music in ipairs(Playlist) do
table.insert(MusicWaitlist, music)
end
local function chooseMusic()
local music = table.remove(MusicWaitlist, 1)
table.insert(MusicWaitlist, music)
return music
end
local function shufflePlaylist()
for i = #MusicWaitlist, 2, -1 do
local j = math.random(i)
MusicWaitlist[i], MusicWaitlist[j] = MusicWaitlist[j], MusicWaitlist[i]
end
end
shufflePlaylist()
local function shuffleWaitlist()
for i = #waitlist, 2, -1 do
local j = math.random(i)
waitlist[i], waitlist[j] = waitlist[j], waitlist[i]
end
end
local TeleportPart = Elevator.TeleportPart
local function TeleportBackToElevator()
for _, player in ipairs(game.Players:GetPlayers()) do
if player:FindFirstChild("ValuesFolder").ActivelyPlaying.Value == true then
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local CharacterPosition = player.Character.HumanoidRootPart.Position
if (CharacterPosition - TeleportPart.Position).Magnitude > 9 then
player.Character:SetPrimaryPartCFrame(CFrame.new(TeleportPart.Position))
end
end
end
end
end
--VALUES-
floors = {"OBBYEND", "MINEFIELD", "Floodescape", "Gamerroom", "Run"}
CountDownTime = 25
items = {}
waitlist = {}
-- FLOOR SCRIPTS --
local function FloorOBBYEND()
local floor = game.Workspace:WaitForChild("OBBYEND")
MainDoor.CanCollide = false
wait(30)
wait(30)
TeleportBackToElevator()
end
local function FloorMINEFIELD()
local floor = game.Workspace:WaitForChild("MINEFIELD")
MainDoor.CanCollide = false
wait(30)
wait(30)
TeleportBackToElevator()
end
local function FloorFloodescape()
local floor = game.Workspace:WaitForChild("Floodescape")
MainDoor.CanCollide = false
wait(30)
wait(30)
TeleportBackToElevator()
end
local function FloorGamerroom()
local floor = game.Workspace:WaitForChild("Gamerroom")
MainDoor.CanCollide = false
wait(30)
wait(30)
TeleportBackToElevator()
end
local function FloorRun()
local floor = game.Workspace:WaitForChild("Run")
MainDoor.CanCollide = false
wait(30)
wait(30)
TeleportBackToElevator()
end
-- ELEVATOR SYSTEM--
for i=1,#floors do
local item = game.ServerStorage.Floors:FindFirstChild(floors[i])
if item ~= nil then
item.Parent = nil
table.insert(items, item)
table.insert(waitlist, item)
else
print("Error:", floors[i], "was not found.")
end
end
function ChooseFloor()
local NewFloor = table.remove(waitlist, 1)
table.insert(waitlist, NewFloor)
CurrentFloor = NewFloor
return NewFloor
end
shuffleWaitlist()
shufflePlaylist()
while true do
local Map = ChooseFloor():Clone()
local music = chooseMusic()
music:Play()
wait(CountDownTime)
music:Stop()
Map.Parent = game.Workspace
ServerFloorCount +=1
MainDoor.Bell:Play()
wait(0.5)
MainDoor.Open:Play()
Tween1:Play()
Tween2:Play()
if CurrentFloor.Name == "OBBYEND" then
FloorOBBYEND()
elseif CurrentFloor.Name == "MINEFIELD" then
FloorMINEFIELD()
elseif CurrentFloor.Name == "Floodescape" then
FloorFloodescape()
elseif CurrentFloor.Name == "Gamerroom" then
FloorGamerroom()
elseif CurrentFloor.Name == "Run" then
FloorRun()
end
MainDoor.CanCollide = true
TweenBack1:Play()
TweenBack2:Play()
wait(5)
Map:Destroy()
end
and my onplayer add looks like this:
game.Players.PlayerAdded:Connect(function(player)
local valuesFolder = Instance.new("Folder")
valuesFolder.Name = "ValuesFolder"
valuesFolder.Parent = player
local activelyPlaying = Instance.new("BoolValue")
activelyPlaying.Name = "ActivelyPlaying"
activelyPlaying.Value = true
end)
@@noobie425 I just now noticed that I forgot to add a line of code in the video which has been causing that error so I just put the fix in the pinned comment
@@unionedspider Oh thanks it works now Thanks for the help
appreciate the video, I'm pretty much following the same thing, with different models and it all works perfectly better then what I tried to make before. Just a few questions, before this video I made a song system where I reference the part containing all the song ids then use GetChildren on it. After I just use math.random to randomly pick and play a song. I tried your method and it works perfectly fine as well, though I don't exactly understand the table syntax and stuff. In your opinion is it better to use the latter or is the former alright?
I don't know if you already done these things but maybe a shop system, leaderboard system (how to make them and save them), changing lighting or camera would be really helpful. Like some floors, my idea is to make it scary, and changing the lighting would be good. And for camera work, it would be cool to make some floors have some sort of cut scene at the beginning.
I personally think the long videos are good, I like seeing your workflow and process. It's very insightful as someone starting to code on studio. Anyways cheers boss.
For the song system I did plan on using math.random but I felt like using this shuffle mechanism because it puts all of the songs in an organized queue line and also prevents the same song from getting picked twice in a row
In the next part I do plan on adding a shop, leaderboard (With datastorage), and lighting changes. I'll try and see if I can do anything for camera effects
Are you gonna make a part 3 or that’s all
Yeah there'll be a part 3
Ok
good tutorial but theres one issue:
sometimes this "ServerScriptService.Elevator:117: attempt to index nil with 'Clone'" error will pop up and it will stop the script from working. how do i fix that?
I'm not sure, I don't know what your script looks like
This tutorial is really helpful so I can make my game but I’m experiencing a problem. After adding the new code onto the script (the part where the SoundPart plays music and stops), the elevator just doesn’t open anymore. If I use the script from Part 1, it still opens.
That means there's an error, you'll have to see what shows up in the output when you test your game. It should be in red text
The output button is in the view tab
@@unionedspiderah ok I see. It says that SoundPart is not a valid member of Folder “Workspace.Elevator”.
I assume I need to put the SoundPart inside the Elevator folder?
Edit: nvm I got it to work. The problem was that the objects like SoundPart and Teleport Pad weren’t in the elevator folder. I appreciate the help
@@MarioYT21 No problem nice job
I loved this vid part 3 would be sick!
One question:
In the next part you will demonstrate how to make the players if is outside of the elevator, teleport again into the elvator?
Already did that
@@unionedspider oh thanks, I only do the 1 part but to be honest, the tutorial see really good and complex, and
I hope that you upload the 3rd part, have a nice day :3
@@Daniel69ElGamer I appreciate it, good day to you too
@@unionedspider thx :3
If you make a part 4 you should make it so on some floors it will kick the player out the elevator and make them participate in the game instead of camping the elevator
good one
you're the best😭😭
I don't understand Where did you get the" ElevatorOpen = false" it tells me that it's a mistake What should I do????????????????????????????????????????????????????????????????
What does the error message say?
@@unionedspider sorry, I just scrolled through the feed and it turned out that I made a mistake
i am not sure if my previous comment got marked as spam or something but i was having trouble with getting the queue elevator to work, and im not sure what i did wrong. do you have any ideas about that? (nice video btw)
Depends on which part of it is working incorrectly. If there's an error message in the output that would help me as well
@@unionedspider no error message appears in the output. the doors open and everything- only problem is i cant enter the actual elevator
theres probably more information from my "held-for-review" comment but maybe because i sent links youtube took it down (they were just google drive links with screenshots, btw)
@@thenyancatcookie For some reason the comment doesn't show up in the "Held for review" area but if you want you can try sending the links again and I'll recheck the comments held for review
@@unionedspider i sent like three comments, and they were all suddenly deleted off of yt :skull:
i guess it's something to do with sending links in a comment section
Is there gonna be more parts?
Probably
Damn, i guess we will never know how to let npcs join the elevator lol
@@hyphenwtf Next video I will
@@unionedspider ill start the tutorial when the NPC tutorial comes out
Great video but i got an error and i have no idea what it means --> ActivelyPlaying is not a valid member of Folder "Players.abbeXDhjalmar16.ValuesFolder"
@@NostalgiaBuilders when you used instance.new to create the "ActivelyPlaying" object did you parent it to the valuesfolder?
@@unionedspider Thank you! It fixed the error! :D
@@NostalgiaBuilders No problem
can you give me game link and make it uncoppylocked for people that having trouble with and thank you for reading this
Here my username :D
-Dinokingplez
I'll make an uncopylocked version when the tutorial series is over
@@unionedspider ok thank you :D