I want to Make a squid game since it looks fun to make, and also its blowing up
I got the whole map finished with teleportation but I got two problems though. the first one is scripting, the “Red Light and Green Light” I want it to appear on screen and change on its own but I simply can’t.
The second one is I want it to kill you when you move when it says red light, I don’t understand how it works, I feel like it works even if your in the lobby its really Confusing, can someone explain how it works? I’m really motivated to learn
I already spent hours trying to find a solution but I cant, i don’t know why I feel like its the way i write it in the search bar.
I plan on making no resets or waiting time, I want the player to enter the game right away without waiting for intermission’s and can play at whatever time they want.
This is my solution:
Create a the gui in workspace and change its value according to timing.Then with a script in ServerScriptService tht checks if the light is green or red and then thru a localscript fire a remoteevent which will b fired when the plr moves and another serverscript service kills the player.
Alright, so I would suggest a RemoteEvent to be put in ReplicatedStorage so we can communicate this ‘light’ variable between the server and clients. Here is the API Documentation on RemoteEvents.
While it is red light, check if their Humanoid state is either Running, Walking or Jumping. If it does, then it indicates the payer is moving and you should kill them if they aren’t in Idle state.
You could make a server script that changes the red light and green light, or use a remote event on a client side script. to do the same. You should also make a light global variable to make things easier. To check if the player is moving on red light,
humanoid.Running:Connect(function(speed)
if speed > 0 and Light.Value == "Red Light" then
humanoid.Health = 0
end
end)
Here, suppose Light is a global variable, here it checks if the player is moving, and if the player is moving while It is on red light, then the humanoid gets killed.
For the red or green light to appear, make a StringValue in workspace (or werevr u want to) and by using a script in ServerScriptService change the string’s value to “Red” or “Green” respectively by the timing of ur choice. Then check if the StringValue's value changed to red or green and if it did connect to different functions.
Killing the player:
Now create a LocalScript and by using a RemoteEvent check if the value changed.
If it did connect it to different functions respectively like If it is green, connect to GoodToMove function or if it is red, connect it to KillPlayer function, if it connects to the KillPlayer function check if the plr is running and if he is, use another RemoteEvent to (when fired) kills the player.
Thts all, if there is any correction or error in my solution pls inform me. It would help me to learn new things and surely help the OP.
Yes, that’s good. The RemoteEvent gives us the ability to communicate to and from the client and server. The function this will bring is the server telling the clients/ players gui to change via a serverscript function (e.g. lightswitch:FireAllClients())
Also, this may be a very long conversation especially with the devforum’s inability to push-notifications, and I would really like to help you, so would you like to talk on Discord? If so, tag: smithgaming#9949