In my obby whenever I die/respawn the game starts respawning me constantly while the screen flashes black, after about a minute or two it stops and it finally respawns me properly. Weird part is when I play on the account that owns the game it doesnt happen, but when I play on an alt account it does happen. Any help is greatly appreciated
#Flashing Black Screen When Respawning
1 messages · Page 1 of 1 (latest)
send a clip
also is this ai, i can't tell
the comments and making a remote event with instance.new is throwing me off
Can you try renamingthe variable spawn? try _spawn instead
Some of it but that's just because I spent like an hour trying to fix it so I resorted to the Roblox ai
And it didn't help
I shall attempt
I'm able to do that in here?
You can send anything here lol
@teal timber if you want I can sit down with you and teach you the basic concepts of this but I need to see more specifically the local script that's firing the remote
sorry it took so long
just does that
for ages
then sometimes it fixes after a minute or two
and then if you die again it keeps happening
is see your problem
you have like 20 of the same script that has player.CharacterAdded which runs when a player respawns/joins the game for the first time
all does the same thing
do I not need it in every checkpoint tho?
you can do all that in one main script
seriously?
** You are now Level 1! **
this is what I have rn
just put all the checkpoints under a folder in workspace
done that
then loop through it and connect the touch event from there
let me write a concept
alr ty
local PlayerService = game:GetService("Players")
local checkpoints = workspace.CheckPointsFolder
function SetCheckpoints()
for index, value in checkpoints:GetChildren() do
value.Touched:Connect(function(basePart)
if basePart.Parent:FindFirstChild("Humanoid") then
local character = basePart.Parent
local player = PlayerService:GetPlayerFromCharacter(character)
local CheckPosition = value:GetAttribute("Checkpoint") -- Vector3 Value
player:SetAttribute("Checkpoint", CheckPosition)
end
end)
end
end
PlayerService.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player:GetAttribute("Checkpoint") then
character:PivotTo(CFrame.new(player:GetAttribute("Checkpoint"))) -- Position Player
end
end)
end)
SetCheckpoints()
probably what i would of done
just a rough sketch
and I'd just make a new script in serverscriptservice and it'd just work?
or do I still need the script in checkpoints
you don't need a script under every checkpoint part
that is bad practice
this script will not work if you copy and paste it
it's for you to understand how to manage things in 1 main script
or a few main scripts
no
alrighty
also i know this is gonna sound really stupid of me
but im getting these scammy popups and I went through all my scripts, models and plugins and i just cant find anything thats causing it
like genuinely
im so lost
i've went through all the models n everything
checked for "prompt"
"marketplace"
in search
removed all my plugins
still getting stuff like this tho
check free model scripts
i never used it but i know people can use something call loadstring
which can run code that isn't written inside the game
yeah i checked for that already but nothing
** You are now Level 2! **
just so confused
usually you want to avoid free models
yeah i barely used any
but if you have to use one, any scripts under the model you can delete
it will never spawn outside of model
pretty much
another way to tell if it's your plugins is make a new experience and see if the problem persists
either way I deleted all my plugins
because i wasnt using them
im gonna make a script first anyway
is there some kind of script I can make to stop the popups or no?
nah you have to find the source
anything you didn't make
mostly scripts
just search for local scripts/server scripts
yeah i have 299 matches
im looking through them
but like keywords would be
loadstring, prompt, marketplace
299 server scripts?
kill bricks and stuff
is it
mostly stuff like this
in parts
should I just go through the whole obby and delete scripts and do it through properties
like kills bricks and transparency and stuff
oh yikes
i have a folder with 50 parts and this one script makes them damage bricks
so I could've just put kill bricks in one folder and then done a script
yea
studio uses your resources
so if your pc is good having 300 scripts would be doable
but in real servers game uses, if i remember a single core intel xeon cpu
and 4 - 6 gbs of ram give or take depending on players
insane lag and insane throttling
it's fine
so what i need to do is delete all the scripts, make one big one for kill bricks and stuff
no need to say that
we all feel dumb in the pursuit for knowledge
everyone been there
you're smart
yea
also if you haven't use modules
modules?
module scripts
it's like a table you can call (require) and it stores and runs code
so i have 2 main scripts and a ton of modules with each chunk of code depending on what i need
ohhhh i think i get it
** You are now Level 3! **
easier to maintain
yesyes
one of my main script
most of the logic is within the modules
the main script is just to connect the events and connections
note i may not be best scripter according to this server skill level
this is just the best way i can help you, and the best i know of soo far
i mean you seem pretty skilled to me
i'm skilled enough to fix the problems i create so i suppose
but you'll get there eventually
only a matter of time
hopefully
okay so
for the checkpoints
I have it so that it plays a sound every time its touched, i removed the script that makes it play but kept the sound in the checkpoints, do I keep the sound in the checkpoints
or do i delete it and keep one in workspace
or a folder or something
i see no problem with having a sound object under every checkpoint
that wont cause lag then?
you can just checkpoint:FindFirstChild("sound") and play it
yeah I have that or something similar in my script anyway
like i deleted the scripts in the checkpoints themselves
and made one big script
but if it was a bigger game
then how would I do it
a folder in workspace
or
replicated storage
or what
if it was a big game
you'd play the sound client side
and let the server detect which players are within range to hear the sound and fire to those clients
okay i guess that makes sense
you'd load all the sound ids in a module script with it's logic
and have one sound object within the player's character
and you'd just configure that one sound object or maybe 5 at a time to play whatever sounds you need
it's quite easy for your game to be unoptimized in roblox
especially if you're planning to cater to mobile users
yeah i'd imagine so
i have another question
so for this
how would I make a script
for it
if i moved all the kill bricks to one folder
and called it just something like "killbrick"
use a for loop
for index, brick in brickFolder:GetChildren() do
brick.Touched:Connect(function()
--damage logic
end)
end
and where would I put the name "killbrick"
or would i do that at all
im assuming it needs the name
of the folder like
yea just name a folder called killbricks or something
and index it and use :GetChildren()
and put it in the brackets
** You are now Level 4! **
i suck at explaining
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
not script.Parent
the script will be under serverscriptservice
it seems you don't know what for loops do
hear me out
DISCORD 📜
Join my Discord Community if you want scripting help, participate in events/challenges, and make friends!
https://discord.gg/WC6kPu5W5P
MEMBERSHIPS 🎁
Get Access To My Scripts + More Perks By Becoming a Channel Member! 👇
https://www.youtube.com/@BrawlDevRBLX/join
BEGINNER ROBLOX SCRIPTING SERIES 🟢
https://youtube.com/playl...
didnt realize making an obby would be so technical
watch this guy beginner playlist
giving you basic knowledge and fundamentals in scripting
building an obby is easy
scripting it is a different story
i respect the blind playthrough
but i recommend watching brawldev, researching your problems from the dev forum (i assure you the problems you have someone already asked) and reading up on roblox api
aka their official wiki for roblox studio explaining every nook and cranny
np
i'll try fix my buggy little game
you got this
I have one last question
sorry
after i make the loop
wait no
i figured it out i think
'all good
quick question
is there a reason this isnt working?
I changed it to if part IsA("Part")
but it still doesnt work
check output
it's most likely erroring at line 6
also hit inside the touch event can touch other parts
okay i fixed
sorry?
the issue was that i accidentally had it in terrain
instead of workplace
space
whoopsies
i see
atleast i wont make that mistake again
sorry I'm like really really new to this
bare with me
also
"part" would be better to use than "basepart"
because its a broader term
right?