Trying to make a Floor is lava game but its not working

I Need Help On My Minigame Script

So Basically I’m trying to make a minigame script but for some reason the status bar wont even do anything it just says 0 all of the time, and the minigame doesn’t even work, Its always supposed to be a lava thing but it doesn’t teleport me at all.

Main Script

local s = script.Status
local vals = game.ReplicatedStorage.vals
t = 0
while true do
	t = 15
	repeat
		t = t-1
		s.Value = "Intermission.."..t
		wait(1)
	until t == 0
	s.Value = "Game starting!"
	wait(2)
	local mapselect = game.ReplicatedStorage.Gammes:GetChildren()
	local choose = map.random(1,#mapselect)
	curnum = 0
	for i =1,#mapselect do
		curnum = curnum +1
		if curnum == choose then
			mapselect[i]:Clone().Parent = workspace
			curmap = mapselect[i].Name
			s.Value = "The Map you will play on is "..mapselect[i].Name
		end
	end
	wait(3)
	local plrs = game.Players:GetChildren()
	for i = 1,#plrs do
		local num = math.random(1,8)
		plrs[i].Character.Head.CFrame = CFrame.new(workspace.Telaports["Part"..num].Position)
		plrs[i].Charatcer.Parent = workspace.Ingame
	end
	t=100
	repeat
		t = t-1
		s.Value = t.." seconds left..."
		wait(1)
	until t ==0 or vals.Winner.Value ~= ""
	if vals.Winner.Value ~= "" then
		s.Value = vals.Winner.Value.. "Has won!"
		vals.Winner.Value = ""
	else
		s.Value = "No one has won "
		wait(3)
		local ingame = workspace.Ingame:GetChildren()
		for i =1,#ingame do
			local plr = game.Players:GetPlayerFromCharacter(ingame(i))
			plr.LoadCharacter()
			workspace[curmap]:Destroy()
		end
	end
end

Winner Pad Script

script.Parent.Touched:Connect(function(hit)
	local h = hit.Parent:FindFirstChild("Humanoid")
	if (h~=nil)then
		game.ReplicatedStorage.vals.Winner.Value = hit.Parent.Name
		script.Parent:Destroy()
	end
end)

Output

  07:32:15.055  Gammes is not a valid member of ReplicatedStorage "ReplicatedStorage"  -  Server - Main:13
  07:32:15.055  Stack Begin  -  Studio
  07:32:15.055  Script 'MapsFolder.Main', Line 13  -  Studio - Main:13
  07:32:15.056  Stack End  -  Studio

Images

Screenshot 2021-03-25 072908 Screenshot 2021-03-25 072944

EmbatTheHybridProgrammer

2m

You wrote Gammes instead of Games

Solution

1

Reply

RFL890Programmer

2m

I think you misspelled “Games” as “Gammes”

Solution

1

Reply

3 Likes

Did you mean to spell “Games” as “Gammes”?

2 Likes

You wrote Gammes instead of Games

2 Likes

I think you misspelled “Games” as “Gammes”

1 Like

YEP, I completly frogot about that

1 Like
  07:55:46.871  MapsFolder.Main:14: attempt to index nil with 'random'  -  Server - Main:14
  07:55:46.871  Stack Begin  -  Studio
  07:55:46.871  Script 'MapsFolder.Main', Line 14  -  Studio - Main:14
  07:55:46.872  Stack End  -  Studio

I fixed the " Gammes " Typo but now this came up

Did you mean to do math.random? or map.random

1 Like

[quote=“NubblyFry, post:6, topic:1129796, full:true”]

  07:55:46.871  MapsFolder.Main:14: attempt to index nil with 'random'  -  Server - Main:14
  07:55:46.871  Stack Begin  -  Studio

You could enter the names of the maps in a table and get one of them randomly.

local maps = {"Map1", "Map2"} --Change the objects with the names of your maps

local mapChoosen = maps[math.random(1, #maps)
1 Like

After that you can also do this:

local getMap = game.ReplicatedStorage.MapsFolder:FindFirstChild(mapChoosen)

MAP RANDOM so do I put it to math?

@StarJ3M it would be better if you put all the parts of the map in a single model and put it in the workspace, insert into the model a part to make the teleport position and then you change the last line of code i wrote with this:

local getMap = game.Workspace:FindFirstChild(mapChoosen)

for _, players in pairs(game.Players:GetChildren()) do
    players.Character:WaitForChild("HumanoidRootPart").CFrame = getMap:FindFirstChild("TeleportPart").CFrame --Change "Teleport Part" with the name of the teleport Part you made so everyone will be teleported in that map
end

Ok, So I test ran it and then it telaported me to the map and cloned it and put it in workspace, but the status still is just 0. When I died and Didnt finish the map this happened.

  08:27:36.974  Charatcer is not a valid member of Player "Players.NubblyFry"  -  Server - Main:29
  08:27:36.975  Stack Begin  -  Studio
  08:27:36.975  Script 'MapsFolder.Main', Line 29  -  Studio - Main:29
  08:27:36.975  Stack End  -  Studio
  08:30:07.487  Disconnect from ::ffff:127.0.0.1|58804  -  Studio

It looks super comcoplicatageeddee2inhdrnei2jo4n3bfry3niugtn3rye42j

Is it in a Script or in a LocalScript?

I was working on a game like that.
You can take a look. (open source)

Misspelling, should be Character

2 Likes

Yes he wrote wrong the object name.

Okay lets see some stuff in you code that has issues i know you already fixes some but lets look at them again:

   local s = script.Status
local vals = game.ReplicatedStorage.vals
t = 0
while true do
	t = 15
	repeat
		t = t-1
		s.Value = "Intermission.."..t
		wait(1)
	until t == 0
	s.Value = "Game starting!"
	wait(2)
	local mapselect = game.ReplicatedStorage.Games:GetChildren()
	local choose = map.random(1,#mapselect)
	curnum = 0
	for i =1,#mapselect do
		curnum += 1   --------simplify that
		if curnum == choose then
			mapselect[i]:Clone().Parent = workspace
			curmap = mapselect[i].Name
			s.Value = "The Map you will play on is "..mapselect[i].Name  --- you basically doing a loop on a Math random which is already choosen no need to loop it
		end
	end
	wait(3)
	local plrs = game.Players:GetChildren()
	for i = 1,#plrs do
		local num = math.random(1,8)
		plrs[i].Character.Head.CFrame = CFrame.new(workspace.Telaports["Part"..num].Position) ---  you cant say Head.Cframe but Neck.C0  this is breaking your game
		plrs[i].Charatcer.Parent = workspace.Ingame
	end
	t=100
	repeat
		t = t-1
		s.Value = t.." seconds left..."
		wait(1)
	until t ==0 or vals.Winner.Value ~= ""
	if vals.Winner.Value ~= "" then
		s.Value = vals.Winner.Value.. "Has won!"
		vals.Winner.Value = ""
	else
		s.Value = "No one has won "
		wait(3)
		local ingame = workspace.Ingame:GetChildren()
		for i =1,#ingame do
			---local plr = game.Players:GetPlayerFromCharacter(ingame(i)) -- not getplayerfrom character but character from player which isnt supported so here remove this line also the character isnt in the workspace yet so it cant be get character from player
			plr.LoadCharacter()
			workspace[curmap]:Destroy()
		end
	end
end