#Trying to code a complex rebirth system, Running into a few issues.
1 messages · Page 1 of 1 (latest)
please format your code properly using
```lua
he sent a text file bro 🤦♂️
could you show only the rebirthing part
pretty sure he could of just sent it in different parts and made it more readable than having to download it and putting it into a seperate script editor
** You are now Level 1! **
Thats not the point, I'm just answering to your stupid suggestion
that's not nice, i was just saying what i think he should do
makes it more readable and easier for coders to go through it
more likely to have his questions answered
Didn't mean to offend but that suggestion is kind of dumb, moreover its pretty obvious he can't format it as its a text file, what you could've suggested instead is he send the part where the rebirthing happens
Please actually take a closer look, before just providing useless suggestion
well i think you're not handling this very maturely. the whole part is required to solve his problem, since it could be an issue completely unrelated to the rebirth, like an issue with a variable and such.
sending it in seperate parts keeps it easily digestable and readable, and it allows for a format.
but sure thing, i'll open up the entire script in a script editor.
but i don't get what the issue is, you could try debugging and making sure the value is correctly being read
The rebirthing part will indeed show you which other functions he might be using since he will need to call them with function()
Moreover, we can get a basic idea of where error might be
and then we can ask for the rest of the code
that means youre on mobile cuz it comes thru normal on PC
my bad i was at work
lemme send what i got. Its ALOT of scripts
so be ready
Ill try and shorten the amount using context to explain parts in the script where rebirth may be used, but doesnt affect its activation
BE FORWARNED
I saw an example script made by iDracius (LordDracius in the scripts)
As this is my first time scripting with roblox, I used it to get a general sense of where I was but noticed it was incomplete, So I had to rewrite a lot of the logic in ways that would both, already fit with what I have, which was QUITE ALOT.... but also keep the old logic intact that I havent gotten to yet.
Theres been a TON of conflict between the changes ive made but most ive gotten ironed out. It seems this is the sore thumb in what ive done so far....
So the Value INT is what tracks my Rebirth leveling
Rebirth itself is a remote function and a value that is tracked when my stats reach a certain threshold, (similar to the way it already existed in Dracius's script)
zen() is essentially what tells me to upgrade.
(I plan to change the composition of this logic to something more fitting to my game when i actually get the rebirth function to work properly)
(The scripts are so long they automatically format to text docs... Most of my scripts are well over 300 to 500 lines)
so ill send each one after another
-
Stats server script:
Reads all the stats, pretty straightforward -
Status server script:
I havent done much of anything with this yet, so ive contemplated if the issue comes from here... -
Rebirth level values Client script (tells me when i can rebirth based on what my stats are at)
-
StatUpdater Client script (this one works alot with the Status Script, so I havent done too much with it besides change a few things for the stats side)
-
moves client script: (Works heavily with status, hasnt had much to any interaction yet, though it doesnt seem to do too much with it)
-
Rebirth? (test client script used to call the rebirth function)
-- When a player joins the game, set up their status and stats
game.Players.PlayerAdded:Connect(function(player)
-- Create a Status folder if it doesn't exist
local statusFolder = Instance.new("Folder")
statusFolder.Name = "Status"
statusFolder.Parent = player
-- Create Stats (Agility, Defense, Ki, Attack) as IntValues inside Status
local stats = {"Agility", "Defense", "Ki", "Attack"}
for _, statName in ipairs(stats) do
local statValue = Instance.new("IntValue")
statValue.Name = statName
statValue.Parent = statusFolder
statValue.Value = 10 -- Default starting value (adjust as needed)
end
-- ✅ Add PvE BoolValue inside Status
local pveValue = Instance.new("BoolValue")
pveValue.Name = "PvE"
pveValue.Parent = statusFolder
pveValue.Value = false -- Default: Not in PvE mode
-- === MODEACTIVE LOGIC: Create mode values to prevent infinite yield errors ===
-- Create a numeric mode value to compare against (used in your UI scripts)
local modeValue = Instance.new("IntValue")
modeValue.Name = "Mode"
modeValue.Parent = statusFolder
modeValue.Value = 0 -- Default mode number (corresponding to "???")
-- Create a string mode value that represents the active mode's name
local modeActive = Instance.new("StringValue")
modeActive.Name = "ModeActive"
modeActive.Parent = statusFolder
modeActive.Value = "???" -- Starting mode—you can change this default
print(player.Name .. "'s status system is set up, including PvE and mode logic!")
end)
-- Function to update a player's stats dynamically
function UpdateStat(player, statName, amount)
if player and player:FindFirstChild("Status") then
local statValue = player.Status:FindFirstChild(statName)
if statValue then
statValue.Value = statValue.Value + amount -- Modify stat value
print(player.Name .. "'s " .. statName .. " is now " .. statValue.Value)
else
print("Stat not found: " .. statName)
end
else
print("Player or Status not found.")
end
end
-- ✅ Function to Toggle PvE Mode
function TogglePvE(player, state)
if player and player:FindFirstChild("Status") then
local pveStatus = player.Status:FindFirstChild("PvE")
if pveStatus then
pveStatus.Value = state -- Set PvE mode
print(player.Name .. "'s PvE mode is now", state and "Enabled" or "Disabled")
else
print("PvE status not found.")
end
else
print("Player or Status not found.")
end
end
-- For testing purposes, here is how you might call the UpdateStat and TogglePvE functions
-- You might want to connect them to certain events or conditions as required.
game.Players.PlayerRemoving:Connect(function(player)
print(player.Name .. " has left the game.")
end)
-- Client-side script handling rebirth attempt
local remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local rebirthEvent = remotes:WaitForChild("Rebirth2")
local acceptButton = script.Parent.Accept -- Assuming your button's name is 'Accept'
acceptButton.MouseButton1Click:Connect(function()
rebirthEvent:FireServer() -- Attempt to rebirth
end)
any scripts I have not adjusted FULLY to the way i want it, still have Dracius's name attached, since it still would technically be his work
sorry @jagged sail, discord automatically converts my scripts to those text docs
likely cuz of their size
whats the exact problem
A series of complications but its best if i just show you
When I press rebirth, you can clearly see nothing is happening
Whats supposed to happen is the bar above is supposed to track all the 4 fields of combat below, increasing the bar slowly when all the stats reach the desired amount
also leveling me up in the leaderboards
instead, i get nun
the reason the bar is gaining without control is because its set so that if it doesnt see the Attack, Ki, Def, and Stamina INT, then it acts as it would normally
well i just don't think it is very good practice to create the remotes beforehand, you should have them pre-existing
that might cause some issues too
make sure to debug everything using prints and check which part fails in your code. does the rebirth load? does the press not work?
without the rebirth remote function then nothing would tell it to change
or that i was even able to use the rebirth function
none of the remotes existed before the code anyways, ive had to add remotes from what LordDracius's script initially had, then pick apart the pieces i want to keep, or delete, and for certain things like the stat gains
i had to code them to work with what I have
because the way I did my stats was much different than what was initially setup
what in the ai am i looking at
that event fires in a seperate script
you seem very condesending and just overall like a bitch tbh
u can act like a tool somewhere else, but i dont need someone looking like this to talk down on me
esp when youre saying things without getting the full gist of how they work. The EXP gain for each set only happens on the certain conditions of their attack
crazy how u deleted your comments to act like u aint being a douche but you already got your comment tagged where you deleted it cuz i replied to it.
At least im not scared to say what I say
** You are now Level 3! **
you disrespected me, so i deleted my advice. figure it out yourself.
lmfao
youre not gonna disrespect me and think im gonna be buddy buddy with you
you tried talking down on me and clowning over some stuff u didnt even understand clearly