#Runservice Shenanigans

1 messages · Page 1 of 1 (latest)

astral crescent
#

I've made a charging function in a modulescript that the server uses upon activation

#

and heaven help me

#

for the past 4 days, I've been trying to solve this

edgy edge
astral crescent
#

then explain

#

it's pretty long

#

basically, through debugging

#

I've found out it breaks once there's more than 1 player charging

#

(cld be from the server not from the function)

#

it creates and inf activation loop

#

so it's stuck either charging

#

or discharging

#

it's almost like when one person charges, others can't charge or they're stuck in the charging state they were

#

basically it

lavish fox
#

Client -> Server put all datas in a table to know which one is holding you probabaly have the server only in one state variables

lavish fox
#

but i assume you do this:

#
--server

local charging = false
local remote = remotepath

remote blh nlah blah:Connect(function()
charging = true
end)
#

im lazy

#

im on phone

#

basically

astral crescent
lavish fox
#

what

astral crescent
#

first the script wld check if the charging connection was active if it was supposed to dsicharge

#

if it was on, it wld disconnect it

#

it did the same when it wanted to charge

#

check if the discharge connection was active before charging, if it was it wld disconnect

astral crescent
astral crescent
#

the only global vairables are the events

#

oh wait

#

the charging and discharging variables are global

#

😭

#

faaahhh

lavish fox
#

LMAO

astral crescent
#

but

#

how wld I make the connections

#

and disconnect them

lavish fox
#

disconnect them if the player leaves

#

ez

#

😎

astral crescent
#

server lag 📈

astral crescent
#

I've been crying over ts for days