#Why does my door stop responding after an ingame event?
1 messages · Page 1 of 1 (latest)
press f9 and tell us error
local quickplr
for i,v in game.Players:GetPlayers() do
quickplr = v
end
if quickplr.Character.Hidden.Value == true then
if workspace.IsLapLeading.Value == true then
game.ServerScriptService.Main.Laps.Value += 1
script.Parent.Parent.Button.Script.Enabled = true
workspace.IsLapLeading.Value = false
workspace.Lock:Play()
if script.Parent.Parent.Button.Uses.Value < 1 then
local random = workspace.Garden:GetChildren()[math.random(1, #workspace.Garden:GetChildren())]
quickplr.Character:PivotTo(random.TP.CFrame)
game.ServerScriptService.Main.ToDo.Value = math.random(1,5)
workspace.Rooms.Value += 1
game.ServerScriptService.Main.Laps.Value = 0
workspace.CurrentDoor.Value = random.Door
workspace.TPguide.Value = random.TP
workspace.Break125.Value = false
end
end
end
end)``` lua
so whats the problem
have you seen the video
^^
same
at the end its supposed to bring me to an room
but the script is fine but for some reason it doesnt input nor works
when i clicked the button and then the door
do you use remoteevents or bindableevents?
i used them once ingame
i made it so if everyone gathers near the door they go to the next room
by using magnitude
and event
the first line script.Parent.ClickDetector.MouseClick:Connect(function(ee)
replace with
script.Parent.ClickDetector.MouseClick:Once(function(ee)
see if that works
nope
doesnt work
okay bro
** You are now Level 5! **
whatever
learn how to script
Btw MouseClick event gives you the player who clicked it in the function argument(what you named ee) so you dont need to fetch it
thats odd, I don't remember there being instances that store other instances as its value
what class is the TPguide instance?
To set make the door set the next room with tpguide and currentdoor, the tp guide makes the enemy spawn in the room after one second of the room loading
does not help what i said btw
omg no way i didnt know that existed😭
no way 😭
it is so useful
i mean
there is attributes too
attributes are more fast
bro i just assumed it didnt because i wanted something like it and some dude on roblox forum said it wasn't a thing </3
he lied
man im sorry but i cant read that
ill send you one last time
if you could atleast make space between lines
well i don't exactly get what u tried to do there, you want the door to tp you to a different place when you press the button??
i removed the button because it was useless
also the dark room is an break room
the button does not do anything
players must gather to the door now
and also yes
thats whats im trying to do
oh my god bro
oohhh
just ask to a ai to make it
local quickplr
for i,v in game.Players:GetPlayers() do
quickplr = v
end
if quickplr.Character.Hidden.Value == true then
workspace.IsLapLeading.Value = false
workspace.Lock:Play()
local random = workspace.Garden:GetChildren()[math.random(1, #workspace.Garden:GetChildren())]
quickplr.Character:PivotTo(random.TP.CFrame)
game.ServerScriptService.Main.ToDo.Value = math.random(1,5)
workspace.Rooms.Value += 1
game.ServerScriptService.Main.Laps.Value = 0
workspace.CurrentDoor.Value = random.Door
workspace.TPguide.Value = random.TP
workspace.Break125.Value = false
end
end)```
for mr skid
and
bro just no
i dont want my games to look soulless
local quickplr
for i,v in game.Players:GetPlayers() do
quickplr = v
end
if quickplr.Character.Hidden.Value == true then
workspace.IsLapLeading.Value = false
workspace.Lock:Play()
local random = workspace.Garden:GetChildren()[math.random(1, #workspace.Garden:GetChildren())]
quickplr.Character:PivotTo(random.TP.CFrame)
game.ServerScriptService.Main.ToDo.Value = math.random(1,5)
workspace.Rooms.Value += 1
game.ServerScriptService.Main.Laps.Value = 0
workspace.CurrentDoor.Value = random.Door
workspace.TPguide.Value = random.TP
workspace.Break125.Value = false
end
end)```
im not saying to use ai to make your code
not like that man
i find it awesome sauce that you thought he didn't think of that
ai does not help btw
bro i am saying to use ai to make space between lines
oh
on what logic
youre talking about the rooms before the break room?
on the blue room it worked
thats the core mechanic of the game
the dark room is an break room.
every room before the dark room should have the lap system
so the dark room is the blue or grey
it is the dark one
the last room
thanks sherlock
is there any errors on the output?
🐊 I'm silly
nope
the code is OK but the is no outputs
we need to find what is wrong first
anddd
before the if check
try to print the hidden value
to see if for some reason it is false
because the sound does not play on the dark room
doesnt print anything
add this print
and see what it prints
when you are on the
dark room
and try to open the door
for some reason it says false
so there is the problem
the value is false
is there another script
that you set the hidden value to true/false?
Yippe
because on this one
the hidden value works by magnitude
you didnt set anything
wait what
where is the script for this
game:GetService("RunService").Heartbeat:Connect(function()
local you = game.Players.LocalPlayer.Character.Torso
local door = workspace.CurrentDoor
local pos = you.Position
local posdoor = door.Value.Position
local magnitude = (pos - posdoor).Magnitude --distance between the two parts
magnitude= magnitude
if magnitude < 11.1 then
game.ReplicatedStorage.Safe:FireServer(script.Parent.Hidden.Value)
else
game.ReplicatedStorage.Exit:FireServer(script.Parent.Hidden.Value)
end
end)
use task.wait btw
not wait
wait is deprecated
what does task.wait do
task.wait is pro wait is noob
** You are now Level 6! **
i think i know why it doesnt work
i havent set the currentdoor value and tp to the break room door
therefore the magnitude catches the previous door instead of the new one
so problem resolved
ty
im not for the weak
also do you know what parameter is
just saw that he already said it
dont do all that to get the player if you already know who it is
the game is supposed to be played together if thats what im understanding
yesnt
is this a local or server script?
i think this would even break if there was 2+ players
do you know what return is?
return returns something
😱
and like
but parameter does
parameter returns something
like
the parameter of the MouseClick event
that you used
on the script
is the player that clicked
ee?
so the parameter returns the player that clicked
yea
ohhh
ee would be the player that clicked
so you wouldnt need to make the for loop to get the player
oh