You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
to know why this Region3 and respawn error
What is the issue? Include screenshots / videos if possible!
the Region3 say i am dont in that region and the script respawn me multiple times
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i tryed to schange the script
the script:
game.ReplicatedStorage.RemotesGames.Level1Start.OnServerEvent:Connect(function(plr, level)
if game.Players:FindFirstChild(plr.Name) then
plr.Character.Head.CFrame = game.Workspace["Level 1"].TpFrame.CFrame
local Gui = script.Parent.Level1Gui:Clone()
Gui.Parent = game.Players[plr.Name].PlayerGui
local Text = Gui.TextLabel
Text.Text = "Start in 5"
wait(1)
Text.Text = "Start in 4"
wait(1)
Text.Text = "Start in 3"
wait(1)
Text.Text = "Start in 2"
wait(1)
Text.Text = "Start in 1"
wait(1)
Text.Text = "Start!"
wait(1)
Text.Text = "Go on the pirate hat in 10"
wait(1)
Text.Text = "Go on the pirate hat in 9"
wait(1)
Text.Text = "Go on the pirate hat in 8"
wait(1)
Text.Text = "Go on the pirate hat in 7"
wait(1)
Text.Text = "Go on the pirate hat in 6"
wait(1)
Text.Text = "Go on the pirate hat in 5"
wait(1)
Text.Text = "Go on the pirate hat in 4"
wait(1)
Text.Text = "Go on the pirate hat in 3"
wait(1)
Text.Text = "Go on the pirate hat in 2"
wait(1)
Text.Text = "Go on the pirate hat in 1"
wait(1)
for i, v in pairs(game.Workspace:GetChildren()) do
if game.Players:FindFirstChild(v.Name) then
local c = v:FindFirstChild("Torso") or v:FindFirstChild("UpperTorso")
local PRT = game.Workspace["Level 1"].Hat1Part
local Region = Region3.new(PRT.Position - (PRT.Size / 2), PRT.Position + (PRT.Size / 2))
local parts = game.Workspace:FindPartsInRegion3(Region,nil, 100000)
for _, part in pairs(parts) do
if part.Parent.Name == plr.Name then
Text.Text = "Good, wait 5"
wait(1)
Text.Text = "Good, wait 4"
wait(1)
Text.Text = "Good, wait 3"
wait(1)
Text.Text = "Good, wait 2"
wait(1)
Text.Text = "Good, wait 1"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 10"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 9"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 8"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 7"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 6"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 5"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 4"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 3"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 2"
wait(1)
Text.Text = "Go On The Melon-Viking Hat! in 1"
for z, s in pairs(game.Workspace:GetChildren()) do
if game.Players:FindFirstChild(s.Name) then
local PRT2 = game.Workspace["Level 1"].Hat2Part
local Region2C = Region3.new(PRT2.Position - (PRT2.Size / 2), PRT2.Position + (PRT2.Size / 2))
local parts2 = game.Workspace:FindPartsInRegion3(Region2C,nil, 100000)
for _, part2 in pairs(parts2) do
if part2.Parent.Name == plr.Name then
Text.Text = "You Win!"
plr:LoadCharacter()
wait(2)
break
else
Text.Text = "You Lose!"
wait(2)
plr:LoadCharacter()
break
end
end
else
Text.Text = "You Lose!"
wait(2)
plr:LoadCharacter()
break
end
end
end
end
end
end
end
end)
This isn’t the solution to your problem, but you can really reduce the size of this script and increase the effeciency by using numerical for loops over having to set the Text one by one yourself.
Here’s an example:
for i = 10, 0, -1 do
--10 is the starting number, 0 is the finishing number and -1 is the increment
Text.Text = string.format("Starting in %d", i)
wait(1)
end
game.ReplicatedStorage.RemotesGames.Level1Start.OnServerEvent:Connect(function(plr, level)
if game.Players:FindFirstChild(plr.Name) then
plr.Character.Head.CFrame = game.Workspace["Level 1"].TpFrame.CFrame
local Gui = script.Parent.Level1Gui:Clone()
Gui.Parent = game.Players[plr.Name].PlayerGui
local Text = Gui.TextLabel
for i = 10,1,-1 do
Text.Text = string.format("Game Starts in %d", i)
wait(1)
end
wait(1)
Text.Text = "Start!"
wait(1)
for i = 10, 1, -1 do
Text.Text = string.format("Go on the Pirate Hat in %d", i)
wait(1)
end
for i, v in pairs(game.Workspace:GetChildren()) do
if game.Players:FindFirstChild(v.Name) then
local PRT = game.Workspace["Level 1"].Hat1Part
local Region = Region3.new(PRT.Position - (PRT.Size / 2), PRT.Position + (PRT.Size / 2))
local parts = game.Workspace:FindPartsInRegion3(Region,nil, 100000)
for _, part in pairs(parts) do
if part.Parent.Name == plr.Name then
for i = 10, 1, -1 do
Text.Text = string.format("Good, Wait %d", i)
wait(1)
end
for i = 10, 1, -1 do
Text.Text = string.format("Go on the Melon-Viking hat in %d", i)
wait(1)
end
wait(1)
for z, s in pairs(game.Workspace:GetChildren()) do
local PRT2 = game.Workspace["Level 1"].Hat2Part
local Region2C = Region3.new(PRT2.Position - (PRT2.Size / 2), PRT2.Position + (PRT2.Size / 2))
print(PRT2.Size)
print(PRT2.Postion)
local parts2 = game.Workspace:FindPartsInRegion3(Region2C,nil, 100000)
for _, part2 in pairs(parts2) do
if part2.Parent.Name == plr.Name then
Text.Text = "You Win!"
plr:LoadCharacter()
wait(2)
break
else
Text.Text = "You Lose!"
wait(2)
plr:LoadCharacter()
break
end
end
end
else
Text.Text = "You Lose!"
wait(2)
plr:LoadCharacter()
break
end
end
end
end
end
end)
i remake the script but the part 2 dont works, and it prints something like: table:4324ze32zz23x
script:
game.ReplicatedStorage.RemotesGames.Level1Start.OnServerEvent:Connect(function(plr, level)
if game.Players:FindFirstChild(plr.Name) then
plr.Character.Head.CFrame = game.Workspace["Level 1"].TpFrame.CFrame
local Gui = script.Parent.Level1Gui:Clone()
Gui.Parent = game.Players[plr.Name].PlayerGui
local Text = Gui.TextLabel
for i = 10,1,-1 do
Text.Text = string.format("Game Starts in %d", i)
wait(1)
end
wait(1)
Text.Text = "Start!"
wait(1)
for i = 10, 1, -1 do
Text.Text = string.format("Go on the Pirate Hat in %d", i)
wait(1)
end
for i, v in pairs(game.Workspace:GetChildren()) do
if game.Players:FindFirstChild(v.Name) then
local PRT = game.Workspace["Level 1"].Hat1Part
local Region = Region3.new(PRT.Position - (PRT.Size / 2), PRT.Position + (PRT.Size / 2))
local parts = game.Workspace:FindPartsInRegion3WithIgnoreList(Region,{game.Workspace["Level 1"]}, 100000)
for _, part in pairs(parts) do
if part.Parent.Name == plr.Name then
for i = 10, 1, -1 do
Text.Text = string.format("Good, Wait %d", i)
wait(1)
end
for i = 10, 1, -1 do
Text.Text = string.format("Go on the Melon-Viking hat in %d", i)
wait(1)
end
for z, s in pairs(game.Workspace:GetChildren()) do
local PRT2 = game.Workspace["Level 1"].Hat2Part
local Region2C = Region3.new(PRT2.Position - (PRT2.Size / 2), PRT2.Position + (PRT2.Size / 2))
local parts2 = game.Workspace:FindPartsInRegion3WithIgnoreList(Region2C,{game.Workspace["Level 1"]}, 100000)
for c, part2 in pairs(parts2) do
if part2.Parent.Name == plr.Name then
Text.Text = "You Win!"
plr:LoadCharacter()
wait(2)
break
else
Text.Text = "You Lose!"
wait(2)
plr:LoadCharacter()
break
end
end
end
else
Text.Text = "You Lose!"
wait(2)
plr:LoadCharacter()
break
end
end
end
end
end
end)