How to make a "ready to play button"?

Hello, everyone! I am very new to scripting and building a game on Roblox. I’m creating a horror game called “WallFright”, where you must escape a maze. Sounds simple right? Well it is, but there is a catch! There are monsters roaming around the maze, so you Gotta be careful. anyways, I tried to make it where the game waits for all players to load, since there is player dialouge, and I don’t want players that take longer to load to miss out on the dialouge, but I couldn’t figure it out. I decided I was gonna make it where when the player loads in, they are prompted with a “ready to play button” and when they click it, it will tell the game that the player is ready to play. then, once all players are ready to play, the game starts.

The problem is… I don’t know how to script any of this. I did learn the basics of scripting in Roblox, and looked up some tutorials, but the tutorial didn’t help because most of them were either outdated and didn’t work, or wouldn’t work when another script was enabled.

If you do post a reply or answer, could you include like a tutorial on how to do it? You don’t have to, but it would really help! thx for reading this post!

1 Like

The problem is… I don’t know how to script any of this. I did learn the basics of scripting in Roblox, and looked up some tutorials, but the tutorial didn’t help because most of them were either outdated and didn’t work, or wouldn’t work when another script was enabled.

Then this is not the right category to post in, hire a scripter in #collaboration:recruitment.

2 Likes

Ok! I just became a member so I’m new to posting topics. I’ll consider hiring someone!

I might know.

Make a Screengui and add a frame and a textbutton inside also add a local script inside the Frame. and place it inside StarterGui.

Place this inside the local script

local player = game:GetService(“Players”).LocalPlayer:WaitForChild(“PlayerGui”)
local YOURSCREENGUINAME = game.StarterGui.YOURSCREENGUI
local TextButtom = script.Parent.TextButton

TextButtom.MouseButton1Click:Connect(function()

	player.YOURSCREENGUINAME.Frame:Destroy()		
end)

So basically try this ill explain along the way:

Add a script in server script service called playerValues or if you have a leaderstats script add this in it:

game:GetService("Players").PlayerAdded:Connect(function(player)
    local ready = Instance.new("BoolValue", player) --Makes a new value called ready in the player
    ready.Value = false
    ready.Name = "Ready"
end)

Next make a remote event in replicated storage called Ready, then add a script in ServerScriptService called ReadyScript add this in it:

local event = game.ReplicatedStorage.Ready

event.OnServerEvent:Connect(function(player, on)
    player.Ready.Value = on
end)

Next add a local script in your button like this:

script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.Ready:FireServer(true)
end)

Last thing you want to check if all the players are ready in your game script like this:


local shouldStart = false
local foundFalse = false
for _, player in pairs(game:GetService("Players"):GetChildren()) do
    if player.Ready.Value and not foundFalse then
        shouldStart = true
    else
        foundFalse = true
        shouldStart = false
    end
end

if shouldStart then
    -- Start Game
end

Hope this helps!

2 Likes

I followed every instruction except for the last one, which I’m confused about. what do you mean by “your game script”.

Ok so the script starts working, but then an error pops up in output saying " Ready is not a valid member of Player “Players.anderdees4857743754” though I’m reading a topic on that right now.

oops there was a type-o. it actully said " Ready is not a valid member of Player"

You didnt name the value to ready, you only named the variable. Because you didn’t specify a name, it defaults to Value (or something like that)

Oh yes sorry my mistake I will edit the post now

Reply has been edited it should work now

Ok so I tried it out, and the error is gone, but now the script doesn’t work.

1 Like

Dude I’m going to be honest with you in the nicest way I can. You are not prepared to make this idea you have. You really need to gather some more experience and research, because what your trying to do won’t be easy, and a few alvinblox tutorials won’t provide enough knowledge to do so. If your dead set on doing it right as this moment, then as the person above said, I’d recommend hiring a scripter. Otherwise, take a month or two, and learn as much as you can. I’m sure you can make this game, just not with your current skill set.

2 Likes

Alirght. Yeah, this project is pretty ambitous. I think what I’m gonna do is learn more about Scritping and starting making some more basic games. thanks for the feedback!

1 Like

If you ever need help you can check out my YouTube channel and I’m always looking for new video ideas if you need help with something!