#How to get sum of value of all players

429 messages · Page 1 of 1 (latest)

sonic oracleBOT
#

studio** You are now Level 3! **studio

clear quest
#

show script

last wing
#

You dont need a script

#

Well you do

unique plume
#

So. . .

#

Um

last wing
#

I think i have a code like you want somewhere in my projects

unique plume
#

@meager sun Show the

#

Them

meager sun
#

Uhm

#

Ok

last wing
#

So you are trying to get the playtime correct?

frail zodiac
#

xd

meager sun
#
game.Players.PlayerAdded:Connect(function(plr)
local Ticket = Instance.new("IntValue", plr)
Ticket.Name = "Ticket"
Ticket.Value = 0
end)```
frail zodiac
#

funi

meager sun
#

What is this?

frail zodiac
frail zodiac
meager sun
#

HUH?

frail zodiac
#

(decently new feature)

meager sun
#

WHEN

frail zodiac
#

they also have a website version of it

#

it uses GPT-4 >:)

meager sun
#

is this good?

frail zodiac
#

(but it also has access to all Roblox docs, making it BETTER than GPT-4)

#

:)

meager sun
sonic oracleBOT
#

studio** You are now Level 7! **studio

last wing
#

and format the ticket value if you want

#
local function formatTime(minutes)
    local hours = math.floor(minutes / 60)
    local remainingMinutes = minutes % 60
    return string.format("%02d:%02d", hours, remainingMinutes)
end
meager sun
#

Let me make it clear okay?

#

I think you do not know what I want

#

So, I making like a stand

#

With npc and when you click E by proxypropmt this fire event and then open a ui, when you click the button in that ui this adding you 1 to the value of the ticket. So, under the npc there is Surface gui, and inside there is textlabel so I want the TextLabel.Text = all the players ticket stats like if player1 has 5 ticket.value and player2 has 4 ticket.value then the text will be 9

#

So, why should I do ?

#

To get the sum of value of all the plrs

last wing
#

So kinda like a voting system\

meager sun
#

You know the roblox talent show?

last wing
#

You could use a invoke server i believe toreduce chances of hackers abusing the remote event

meager sun
#

Nah

#

I just need to finish this thing

#

Idk how to do it

#

I tried to do players:GetPlayers and get all the values but this not working /:

last wing
#

Let me make a quick small code for you

#

This is all serverscript untill i say its localscript

#

You can remove the if not ticketdata then if you already implemented the ticketdata.

sonic oracleBOT
#

studio** You are now Level 2! **studio

last wing
#

Here ill send you the code that will automaticlly add the folders

#

and such

meager sun
#

Bruh

last wing
#

Ok ok

#

too much?

meager sun
#

PlayerGui? TicketUi?

last wing
#

Show me ur structure to your textlabel.

meager sun
#

I just said I want to do

#

That

#

The text label in the sufrace gui

#

Which in workspace

#

Her text

#

Means the label.text will be

#

=

#

All the players ticket value

#

Sum of value of all players

last wing
#

So you want a total of all the players ticket value on a. Textlabel?

meager sun
#

Yes

last wing
#

easy

#

You can loop thru alllll the players data folder (leaderstats) and look for the ticket value, add t hem up

#

is the value of tickets held under the player data

last wing
#

for loop

#

do a ipair look

sonic oracleBOT
#

studio** You are now Level 1! **studio

last wing
#

for _ , v in ipairs(players:Getchildren) do

#

I’m on mobile so

meager sun
#

*GetPlayers

#

And i tried this not working

#

I do

last wing
#

The player variable should reference your player location

#
local total = 0

for _, player in pairs(game.Players:GetPlayers()) do
    local leaderstats = player:FindFirstChild("leaderstats")
    
    if leaderstats then
        local ticketValue = leaderstats:FindFirstChild("ticket")
        
        if ticketValue then
            total = total + ticketValue.Value
        end
    end
end

print("Total tickets:", total)
#

what it should look like

#

i think

last wing
#

where are u storing ur variable

#

are you in a localscript?

#

For tickets

#

or a serverscript

meager sun
#

Server

last wing
#

Are you storing it in leaderstats?

meager sun
last wing
#

i just made that up

#

dont know where the ticket place is

last wing
meager sun
#

Yep

last wing
#

Then you won’t use leader stats to manipulate it lol

meager sun
#

I know..

#

I did not use

last wing
#

so where u going wrong then

#

send ur code

meager sun
#

IDK

last wing
#

stop making it hard on us

meager sun
#

Bruh

last wing
#

or the fragment

#

of the part

last wing
#

what are we supposed to do with the location of it

#

the part where you scan for the total or the players

meager sun
#

THERE IS NO SCRIPTT

#

Listen

#

Outside this stuff

#

There is

#

A script

last wing
meager sun
#

That adding amount

#

So

#

I need to do

#

When the value changed

last wing
#

local function calculateTotalTickets()
local totalTickets = 0

for _, player in pairs(game.Players:GetPlayers()) do
    if player:FindFirstChild("Ticket") then
        totalTickets = totalTickets + player.Ticket.Value
    end
end

print("Total Tickets: " .. totalTickets)

end

game.Players.PlayerAdded:Connect(function(plr)
local Ticket = Instance.new("IntValue", plr)
Ticket.Name = "Ticket"
Ticket.Value = 0

calculateTotalTickets()

end)

game.Players.PlayerRemoving:Connect(function()
calculateTotalTickets()
end)

meager sun
#

I do not want to print it

last wing
#

the print is simply for testing

meager sun
#

I want to updae the text

#

Oh

last wing
#

Then update the text with the total…

last wing
meager sun
#

Yes

last wing
#

I’m not gonna baby you with the answer I’ve given you the hardest part lol now just reference ur gui

meager sun
#

Baby you?

#

Lol

#

😭

last wing
#

how tthe crust are you scripter?

meager sun
#

:

last wing
#

💀

meager sun
unique plume
#

@meager sunSo what happend?

meager sun
#

I eating fish rn

unique plume
#

You know RTS?

#

@last wing @clear quest @last wing

last wing
#

?, no

clear quest
#

what

unique plume
#
Roblox

Check out Roblox Talent Show ❄️🎄. It’s one of the millions of unique, user-generated 3D experiences created on Roblox. 🎤 Step into the world of Roblox Talent Show, the largest and most innovative talent competition game on the Roblox platform! Show your skills to the Judges and earn a rating based on your performance!

Within Roblox Talent Show,...

clear quest
#

i forgot i was in this thread

unique plume
#

You know it?

clear quest
#

no

last wing
#

He sent you the code

#

now you have to refernce itto the ui

unique plume
#

When you start

#

You have to take a number

#

a "Tag"

#

Then

#

You see on ur shirt the tag

#

And on the sign the next number

#

You can take

#

So we want to know how to count all the players value in server

#

Got it?

last wing
#

yeah he sent u the code

sonic oracleBOT
#

studio** You are now Level 3! **studio

unique plume
#

Who?

last wing
#

juzza

last wing
#

yes, since our limited knowledge of the code, execpt the tickets he could only make this to help you i guess

#

Listen to this @unique plume

last wing
#

Listen to the voice note

unique plume
#

You say that every time you click its add 1

#

so

#

He dosent need to take the sum value?

#

One sec we are trying

last wing
#

No cause if you add one it will make its own sum lol

#

Just make sure to add it to the variable you made

#

local tickets = 1

If click then
Tickets += 1

#

Basic pseudo code

unique plume
#

Yes

#

He is trying

last wing
#

y’all need to relearn scripting if ur struggling with this

#

It’s so simple

meager sun
#
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.GetNumberOfTag
game.Players.PlayerAdded:Connect(function(plr)
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false
    
    local Ticket = Instance.new("IntValue", plr)
    Ticket.Name = "Ticket"
    Ticket.Value = 0
    
    
end)
remote.OnServerEvent:Connect(function(player)
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")
    if InRound.Value == true then
        return "Can not enter"
    else
        InRound.Value = true
        if PlayerTicket then
            PlayerTicket = PlayerTicket.Value + 1 
            PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()
            game.Workspace.GetTag.SurfaceGui.TextLabel.Text = PlayerTicket.Value
            end)
        end
    end
end)```

server script
#
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.GetNumberOfTag
local btn = script.Parent
local frame = game.StarterGui.MainInterface.TagSelectFrame
btn.MouseButton1Click:Connect(function(plr)
    local TweenInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    local Goal = {}
    Goal.Position = UDim2.new(0.5, 0, 1, 115)
    local tween = game:GetService("TweenService"):Create(frame, TweenInfo, Goal)
    tween:Play()
    
    remote:FireServer(plr)
end)```
local script
last wing
#

Use invokeserver if you want to get info from a localscript

#

since thats the purpose of a remotefunction

meager sun
#

oh

#

lemme try

last wing
#

and much better than a remotefunction

meager sun
#

wait invoke server is it a remote function

#

so why you said much better than a remote function

#

:-;

last wing
#

I mean they are better than remote events

#

since they are made mostly to retrieve information

meager sun
#
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction

game.Players.PlayerAdded:Connect(function(plr)
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false

    local Ticket = Instance.new("IntValue", plr)
    Ticket.Name = "Ticket"
    Ticket.Value = 0
end)

remote.OnServerInvoke = function(player)
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")

    if InRound.Value == true then
        return "Can not enter"
    else
        InRound.Value = true
        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()
                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                if SurfaceGui then
                    SurfaceGui.TextLabel.Text = PlayerTicket.Value
                end
            end)
        end
    end
end```

so
#

this is the server script

#
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction
local btn = script.Parent
local frame = game.StarterGui.MainInterface.TagSelectFrame

btn.MouseButton1Click:Connect(function()
    local TweenInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    local Goal = {}
    Goal.Position = UDim2.new(0.5, 0, 1, 115)
    local tween = game:GetService("TweenService"):Create(frame, TweenInfo, Goal)
    tween:Play()

    remote:InvokeServer()
end)```
#

this is local script

#

I did t by a remote function

#

And still

#

not working /:

last wing
#

SERVERSCRIPT


remote.OnServerInvoke = function(player)
            local InRound = player:WaitForChild("InRound")
            local PlayerTicket = player:WaitForChild("Ticket")

            if InRound.Value == true then
                return "Can not enter"
            else
                InRound.Value = true
                if PlayerTicket then
                    PlayerTicket.Value = PlayerTicket.Value + 1 
                    PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()
                        local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                        if SurfaceGui then
                            return PlayerTicket.Value
                        end
                    end)
                end
            end
            

 
    
end
meager sun
#

PART.TOUCHED????????

last wing
#

wrong 1

#

combined a script of mine

meager sun
#

Why fire clients

last wing
#

mb combined 2 scripts

#

localscript

local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction
local btn = script.Parent
local frame = game.StarterGui.MainInterface.TagSelectFrame

btn.MouseButton1Click:Connect(function()
    local TweenInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    local Goal = {}
    Goal.Position = UDim2.new(0.5, 0, 1, 115)
    local tween = game:GetService("TweenService"):Create(frame, TweenInfo, Goal)
    tween:Play()

    local Information = remote:InvokeServer()
    TextLabel.Text = tostring(Information)
end)
sonic oracleBOT
#

studio** You are now Level 4! **studio

last wing
#

Something like this

#

would work

meager sun
#

What abt serverscript

#

tostring the remote invoke? ;-;

last wing
#

You must not know how a rmeotefunction work do you?

#

look it up on docs

meager sun
#

I kinda know you just invoke server and then in the server creating function but what is the information

#

how can I pass it ;-;

last wing
#
remote.OnServerInvoke = function(player)
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")

    if InRound.Value == true then
        return "Can not enter" --passing this information
    else
        InRound.Value = true
        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()
                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                if SurfaceGui then
                    return PlayerTicket.Value --Passing this information
                end
            end)
        end
    end
end
meager sun
#

OH

#

OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

last wing
#
remote.OnServerInvoke = function(player)
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")

    if InRound.Value == true then
        return "Can not enter" -- Return a string indicating the reason
    else
        InRound.Value = true

        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 

            -- Connect a function to the PropertyChangedSignal
            local ticketChangedConnection
            ticketChangedConnection = PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()
                -- Check if the SurfaceGui exists
                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                if SurfaceGui then
                    -- Disconnect the event to avoid memory leaks
                    ticketChangedConnection:Disconnect()
                    -- Return the updated PlayerTicket.Value
                    return PlayerTicket.Value
                end
            end)
        end
    end

    return "Unable to process request"
end

``` made this abit more complicated
#

but same thing

#

i would recommend using this

meager sun
#

isn't my job to write it for all the server?

last wing
#
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction
local btn = script.Parent
local frame = game.StarterGui.MainInterface.TagSelectFrame
local TextLabel = frame:WaitForChild("TextLabel")

btn.MouseButton1Click:Connect(function()
    local TweenInfo = TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    local Goal = {}
    Goal.Position = UDim2.new(0.5, 0, 1, 115)
    local tween = game:GetService("TweenService"):Create(frame, TweenInfo, Goal)
    tween:Play()

    local Information = remote:InvokeServer()

    -- Update the TextLabel directly with the returned information
    TextLabel.Text = tostring(Information)
end)

last wing
meager sun
#

this asking the info from the server

#

and in each client it will write the num

last wing
#

yes

meager sun
#

but I need the text to be write in server

last wing
#

why?

meager sun
#

because I will do something with then numbers

#

and

#

also

#

not working lol

last wing
#

debug it and some prints to see where it went wrong

meager sun
#

k

last wing
#

What else would you use?

meager sun
#

idk I trying whatever you offer me lol

last wing
#

remote event would work

last wing
#

but worry about hackers

#

then add a checking system

#

hackers don’t exist anymore

#

blah blah blah

#

lol

#

they kinda do

#

not on pc atleast

#

ive heard they use mobile emulators

#

Nope they added Byron to mobiles

#

to make e xploits

#

today?

#

That was a bypass ages ago

last wing
#

That was a bypass ages ago as I said

#

not really

#

The only exploit rn is a AI aimbot

sonic oracleBOT
#

studio** You are now Level 3! **studio

last wing
#

hacks on mobile still works

#

no it doesn’t

meager sun
meager sun
#

even in xbox lol

last wing
#

How to Exploit on PC : https://youtu.be/7cBWk4jMNcE
Best Working Free Executor : https://youtu.be/omilO4k4WMM
How to Get Codex Key : https://youtu.be/kq9G6rBivtk
▬▬▬▬▬▬▬▬▬
Download Scripts : https://robloxscripts.net/
FREE MOBILE EXECUTOR : https://codex.lol/
Giveaways & Support at https://discord.gg/robloxexploits
▬▬▬▬▬▬▬▬▬
[🎁GIFT] Roblox Bl...

▶ Play video
#

Found this

#

they still work on mobile emulators

#

not on pc or stuff

meager sun
#

there is no errors and I added prints

#

someone can save my day?

last wing
#

I love people sending virus YouTube videos as evidence

meager sun
#

LOL

last wing
#
remote.OnServerInvoke = function(player)
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")
    print("1")
    if InRound.Value == true then
        print("2")
        return "Can not enter" -- Return a string indicating the reason
        
    else
        InRound.Value = true
        print("3")
        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            print("4")
                -- Check if the SurfaceGui exists
                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                print("5")
                if SurfaceGui then
                print("6")
                    -- Return the updated PlayerTicket.Value
                    return PlayerTicket.Value
            end
            
        end
    end

    return "Unable to process request"
end

meager sun
#

juzza you got any ideas how to fix it?

last wing
#

like these prints?

last wing
#

dont mind the code

#

just used ur code for this example

meager sun
#

yes i did a lot prints

#

lemme do even more

last wing
sonic oracleBOT
#

studio** You are now Level 5! **studio

last wing
#

you can see there on mobilke

#

mobile

#

on the right side

#

They are literally downloading the app on pc

#

It’s a virus video

#

the video dont matter

#

about the downloads

meager sun
#
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction

game.Players.PlayerAdded:Connect(function(plr)
    print("1")
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false

    local Ticket = Instance.new("IntValue", plr)
    Ticket.Name = "Ticket"
    Ticket.Value = 0
    
    if Ticket then
        print("2")
    end
end)

remote.OnServerInvoke = function(player)
    print("3")
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")

    if InRound.Value == true then
        return "Can not enter"
    else
        InRound.Value = true
        print("4")
        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            print("5")
            local ticketChangedConnection
            ticketChangedConnection = PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()

                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                if SurfaceGui then
                    print("6")
                    ticketChangedConnection:Disconnect()
                    print("7")
                    return PlayerTicket.Value
                end
            end)
        end
    end

    return "Unable to process request"
end```
last wing
#

or what ever

#

The video literally has two different people on it

last wing
#

ok doesnt matter

last wing
#

Yeah it does cause ur trying to say exploits exist but they are patched rn

#

lol

meager sun
last wing
#

just get a mobile emulator

#

and install a executer

#

done

meager sun
#

well

#

I guess nobody knows

last wing
#

did you print the information?

meager sun
meager sun
#

sec

#

no error

#

not printing info

last wing
#

print(Information) or "None" something like that

#

forgot how it works

meager sun
#

ok

sonic oracleBOT
#

studio** You are now Level 8! **studio

meager sun
#

so

#

infomation = Unable to process request

#

this writed in the text

#

instead of the number this

last wing
#

alright

meager sun
#

and it said information is this because you did if it is not working so it will retrurn it

#

rip script

#

2 hours old

#

changed - SO MUCH TIMES

#

Working - Hell nah

last wing
#
remote.OnServerInvoke = function(player)
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = player:WaitForChild("Ticket")

    print("Checking conditions for player:", player.Name)

    if InRound.Value == true then
        print("Condition 1 met: Can not enter")
        return "Can not enter"
    else
        InRound.Value = true
        print("Condition 1 not met: Setting InRound to true")

        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            print("Condition 2 met: Incrementing PlayerTicket")
            return PlayerTicket.Value
        else
            print("Condition 2 not met: PlayerTicket does not exist")
        end
    end

    warn("Unexpected condition: Unable to process request")
    return "Unable to process request"
end

meager sun
#

bruh added any print he cans think about

last wing
#

chikll

#

i really like debugging

meager sun
#

20:23:30.253 Condition 1 not met: Setting InRound to true - Server - ServerTag:31
20:23:30.253 Condition 2 met: Incrementing PlayerTicket - Server - ServerTag:35

last wing
#

Ok so that is good

#

that means the return PlayerTicket.Value has been reached

#

did u get a print from the localscript?

meager sun
#

ye

#

:24:49.002 1 - Client - LocalScript:16

last wing
#

the 1 is the playerticket

#

there it works

meager sun
#

lemme test now

#

YESSS

#

SUII

#

SUIIIIIIIIIIIIIIIIII

#

Ty!

meager sun
last wing
#

me to o

#

try testing it out in a 2 player game or a 3 player game

#

if the ticket value is set to 0 like normal it should be 3

meager sun
#

oh yes

#

bruh

#

so

#

I was right

#

because you did that

#

label.text = information

#

in the client

#

so 2 players

#

can not see the other number

#

I tested it with my friend

#

he sees 1 when he clicked

#

but I see 0

#

;-;

last wing
#

ofcourse

#

cuz the ticket is in the player

#

you can either store a local variable or add a int value in serverstorage or serverscriptservice

#

choose which one

meager sun
#

uhmm

#

I think a int

last wing
#

already go add one

#

and name it TicketCount

#

in serverstorage

meager sun
#

ok

last wing
#

did u do it?

meager sun
#

yes

last wing
#
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction


game.Players.PlayerAdded:Connect(function(plr)
    print("1")
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false
end)

remote.OnServerInvoke = function(player)
    print("3")
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = game:GetService("ServerStorage").TicketCount
    if InRound.Value == true then
        return "Can not enter"
    else
        InRound.Value = true
        print("4")
        if PlayerTicket then
            PlayerTicket = PlayerTicket+ 1 
            print("5")
            local ticketChangedConnection
            ticketChangedConnection = PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()

                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                if SurfaceGui then
                    print("6")
                    ticketChangedConnection:Disconnect()
                    print("7")
                    return PlayerTicket.Value
                end
            end)
        end
    end

    return "Unable to process request"
end
meager sun
#

this is the server script

#

ohh

#

oh

#

game.Players.PlayerAdded:Connect(function(plr)
print("1")
local InRound = Instance.new("BoolValue", plr)
InRound.Name = "InRound"
InRound.Value = false
end) why?

last wing
#

cuz the ticket value in the player is the problem why

#

cuz its returning the PLAYER'S ticket value

meager sun
#

lemme test

#

20:41:20.164 ServerScriptService.ServerTag:23: attempt to perform arithmetic (add) on Instance and number - Studio

last wing
#
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction


game.Players.PlayerAdded:Connect(function(plr)
    print("1")
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false
end)

remote.OnServerInvoke = function(player)
    print("3")
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = game:GetService("ServerStorage").TicketCount
    if InRound.Value == true then
        return "Can not enter"
    else
        InRound.Value = true
        print("4")
        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            print("5")
            local ticketChangedConnection
            ticketChangedConnection = PlayerTicket:GetPropertyChangedSignal("Value"):Connect(function()

                local SurfaceGui = game.Workspace.GetTag.SurfaceGui
                if SurfaceGui then
                    print("6")
                    ticketChangedConnection:Disconnect()
                    print("7")
                    return PlayerTicket.Value
                end
            end)
        end
    end

    return "Unable to process request"
end
meager sun
#

20:43:14.347 ServerScriptService.ServerTag:23: attempt to perform arithmetic (add) on string and number - Studio

#

still

last wing
#

there

meager sun
#

ohhh because the space

last wing
#

no because .Value

#

was not ther

meager sun
#

same error lol

meager sun
#

lol

#

sec

#

testing

#

20:46:07.636 Unable to process request - Client - LocalScript:16

last wing
#
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local remote = rs.Remotes.RemoteFunction


game.Players.PlayerAdded:Connect(function(plr)
    print("1")
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false
end)

remote.OnServerInvoke = function(player)
    print("3")
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = game:GetService("ServerStorage").TicketCount
    if InRound.Value == true then
        return "Can not enter"
    else
        InRound.Value = true
        print("4")
        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1 
            print("5")
                    print("6")
                    
                    print("7")
                    return PlayerTicket.Value
             
          
        end
    end

    return "Unable to process request"
end
#

try this

#

here

meager sun
#

blud

last wing
#

??

meager sun
#

working

#

lol

last wing
#

yeah its most likely because of the screengui and the changepropertysignal

#

because when the remote function got ran it was waiting for a change in the value.

meager sun
#

lemme test with 2 players

#

not showing me when my friend clicked

#

;-;

#

oh wait

#

there is an error

#

sec sec

#

something happend sec

#

listen

#

I tested it with my friend

#

he clicked I saw still 0

#

and he saw 1

#

and when I clicked

#

I saw 2

#

and he saw still 1

last wing
#

send the error message

meager sun
#

no error

#

lol

last wing
#

hmm try this not sure if this will work

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.Remotes.RemoteFunction

Players.PlayerAdded:Connect(function(plr)
    print("1")
    local InRound = Instance.new("BoolValue", plr)
    InRound.Name = "InRound"
    InRound.Value = false
end)

remote.OnServerInvoke = function(player)
    print("3")
    local InRound = player:WaitForChild("InRound")
    local PlayerTicket = game.ServerStorage:WaitForChild("TicketCount") -- Make sure TicketCount is a child of ServerStorage

    if InRound.Value then
        return "Cannot enter, already in round"
    else
        InRound.Value = true
        print("4")

        if PlayerTicket then
            PlayerTicket.Value = PlayerTicket.Value + 1
            print("5")
            
            print("6")
            
            print("7")
            return PlayerTicket.Value
        end
    end

    return "Unable to process request"
end

meager sun
#

Lemme test

#

And

#

Not working