Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

1 by 1 obby minigame, not detecting brick touches?

Asked by 8 years ago

In my game, I have a minigame where each player takes in turns to complete the obby.

If the player falls (or fails), it will touch and invisible brick on the floor, stop their turn, teleport them to the waiting podium, take their name out of a global table and change their team to an other team. If a player completes it, the player will stay on the team and in the table, their score will be increased by 1 and their turn will end.

This is the script;

01local replicatedStorage = game:GetService('ReplicatedStorage')
02local status = replicatedStorage:WaitForChild('InfoValue')
03 
04local inGamers = game.Teams.Players:GetPlayers()
05 
06local loops = 0
07 
08local MG = game.Workspace.Minigame:FindFirstChild("ObbyMinigame")
09local teleTo = MG.TeleportToSpawn
10local finishPart = MG.CompletePart
11local failPart = MG.FailPart
12 
13local spawns = game.Workspace.Minigame:FindFirstChild("ObbyMinigame"):FindFirstChild("Spawns"):GetChildren()
14local allspawns = math.random(1, #spawns)
15local randomspawn = spawns[allspawns]
View all 48 lines...

In the 'FailPart' and 'CompletePart', I have a BoolValue and a script that does this;

1-- In CompletePart
2local spawns = game.Workspace.Minigame:FindFirstChild("ObbyMinigame"):FindFirstChild("Spawns"):GetChildren()
3local allspawns = math.random(1, #spawns)
4local randomspawn = spawns[allspawns]
5 
6script.Parent.Touched:connect(function(char)
7    script.Parent.Completed.Value = true -- FailPart says 'script.Parent.Failed.Value = true'
8    char.Torso.CFrame = CFrame.new(randomspawn.Positon + Vector3.new(0, 5, 0))
9end)

No errors in the output.

0
So... what's the problem there? You didn't tell what's going on! The title isn't enough, you gotta be more specific! OfcPedroo 396 — 7y
0
I don't know what you're talking about, but here's something: In your timer, add wait(1) so it actually ticks down per second instead of all at once. DeceptiveCaster 3761 — 7y
0
Script #2 , line #8 --> randomspawn.Positon? Is it supposed to be Position? Also, Script #2, line #6, :connect() is deprecated. Use :Connect() instead. Bilinearly 58 — 6y

Answer this question