hello, I am trying to make a local script run at a certain time for all players (this is a reserved server, and a specific group of players are being teleport in) my goal with this was to have all the players in a block like structure, and the "ground" of the box will cancollide off which will let the players fall into the main game which will have a detector that will broadcast an event to start the script when touched. I am aware this is not the best solution, but after researching this is the only thing I can come up with.
this doesn't work for some reason because the floor automatically lets the players fall through, even though I set it as cancollide on. I tried deleting the script and then the ground of my structure was fine, and players weren't able to fall through, so I came to the conclusion that the wait(10) wasn't working for some reason.
here is my code, "down" is the ground that should hold the players and then turn cancollide off which lets them fall through.
wait(10) workspace.down.CanCollide = false
I doubt anything I said made sense, but basically the wait(10) won't wait. I tried searching up help but nothing matching my problem helped. thanks for the help!
Maybe try something like the following to ensure the player has been added:
game:GetService("Players").PlayerAdded:Connect(function() wait(10) workspace.down.CanCollide = false end)
This, however, will fire every time a new player joins the server. If you want it to happen only when the server starts (or when the first player joins), write the following instead:
local players = game:GetService("Players") players.PlayerAdded:Connect(function() if #players:GetPlayers() == 1 then wait(10) workspace.down.CanCollide = false end end)
Hope this helps.
i think you need to put some coding before the "wait (10)" bit perhaps plus also some other things
workspace.down (function() wait (10) then workspace.down.CanCollide = false
if that does not work then i will message you next time when i know the answer