#forsaken/DbD fangame generator sync with other players

1 messages · Page 1 of 1 (latest)

tranquil atlas
#

so im making a game inspired by forsaken and DbD, but i need help on how to make the generators sync with the other players, to stop the generator from being completed again (i also dont know how to make a generator 'done' and not be able to be completed again (sorry i used chatGPT to help with most of this but im trying to stop using AI))
im very new to scripting, so youll probally see me in this forum again lol im trying to get out of scratch coding as its very limiting.
do i need to send the studio file? or the scripts? idk sorry

fiery snow
#

for example:


local Finished = false

local function Example()
      if not Finished then
          ...
          Finished = true
      end
end
tranquil atlas
#

ok thanks

#

so would something like if Finished == true
[input generator code]

#

work

fiery snow
#
local Finished = false

local function ExampleAgain()
      if Finished == true then return end
    -- your whole ass code here
end
#

something like this could work aswell

#

OR

tranquil atlas
#

would the boolean value be the same for everyone? so the same gen cant be dont multiple times?

fiery snow
#
local Finished = script.Parent.BooleanValueObject -- example of a path to a boolean value obj

local function ExampleAgain2()
      if Finished then return end
      -- you can also try
      if Finished.Value == true then return end
end
fiery snow
#

You need to use a RemoteEvent for this to work in this case, guessing its a GUI

tranquil atlas
#

yh its in a localscript lol

fiery snow
#

Kindof like this for example:

Local:

local RemoteEvent = pathtoyourremoteevent

RemoteEvent:FireServer(...) -- ... means arguements, like arg1, arg2, or true, false so on and so forth. you can basically transfer data or anything to the server. or just none

Server:


local RemoteEvent = pathtoyourremoteevent

RemoteEvent.OnServerEvent:Connect(function(...)
    -- code here
end)
tranquil atlas
#

thanks

fiery snow
#

Also, just a reminder

It's okay to use AI to assist you in understanding and fixing, not make it do all of it.

#

If you need help on understanding something, your best bet is Google, Youtube, DevForums, and or ChatGPT (i reccomend a LuaU type bot)

If theres no answer on it, then you can go here.

tranquil atlas
#

ok thanks :]

sand stoneBOT
#

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

fiery snow
#

Just dont use it to make the whole script for you

#

^^

tranquil atlas
#

would numbervalues work aswell?
say, if one person got it to 40%
the generator would stay at 40% for everyone else

fiery snow
#

Aslong as its transfered to the server, then its most defenitely okay