As I said, the baby module is given through a remote event to this local script when triggered for the first time,however, I want it to just display when u equip the baby tool, currently only works on the first equip and after that it just displays whenever I add a new baby to my backpack. (through a proximity prompt to pick it up, the one responsible for giving the baby module) I'll probably just have to rewrite all this 😔
#Baby data module not working properly(data given through remote event when picked up, read below)
1 messages · Page 1 of 1 (latest)
Pls no txt file im on mobile snd i cant read it
Sorry it was too long 😦 I can send a pic
I'll just try splitting it
local function delOld(GUI)
for i, v in pairs(GUI:GetChildren()) do
if v:IsA("TextButton") then
v:Destroy()
end
end
end
emptyLabel.Visible=false
local function equipped()
delOld(mainGUI)
if #bp:GetChildren() == 0 then
emptyLabel.Visible = true
else
emptyLabel.Visible = false
end
for index, tool in pairs(bp:GetChildren()) do
if tool:IsA("Tool") then
local button = Instance.new("TextButton")
button.Text = tool.Name
button.Parent = mainGUI
button.ZIndex = 3
tool.Equipped:Connect(function()
equipSlot = index
instruction.Text = "Equipped: " .. tool.Name
ReplicatedStorage.babyData.OnClientEvent:Connect(function(babyData)
print("Received baby data:")
canProceed = true
delOld(babyDataDisplay)
for key, value in pairs(babyData) do
local label = Instance.new('TextLabel')
label.Text = tostring(value)
if key == 'SkinColor' then
label.Text = value.Name
end
label.Parent = babyDataDisplay
label.Visible = true
label.ZIndex = 3
end
end)
end)
tool.Unequipped:Connect(function()
delOld(babyDataDisplay)
if equipSlot == index then
equipSlot = 0
instruction.Text = 'Hold the baby you want to sell'
canProceed = false
end
end)
end
end
end
bp.ChildAdded:Connect(function()
equipped()
end)
bp.ChildRemoved:Connect(function()
equipped()
end)
equipped()```
nvm it fit
plis help brochacho😔
Il try my best brorito
Hold on
So to clarify, the issue is that it works once? @slow pecan
But then its stuck?
It works as intended once (creates the labels when the baby tool is equipped,removes when unequipped) but on the second try it wont let u equip it back when unequipped and it automatically makes the labels when you trigger the proximity prompt instead of equipping the baby tool
i can send a vid
Be honest tho, did you use ai for this? Il still try to fix it for you dw
hell no
Would be nice
Then why were you so formal with the names ;-; like 90% of devs dont use names this well
i use cgpt for debugging but almost always makes stuff worse and I never copy the scripts, especially when I dont understand them, on this one eg I only needed help with the module cause its my first time working with modules but its not even 1/10 of the script and I made sure to understand it and not just copy it, I dont recall what u mean by the names tho cause Im really shit at managing scripts and did not use AI for anything else
anyways sorry 4 yapping ill send the recording
All good dw about it, ai is just a faster way of doing stuff as long as you dont let it write the entire script
yo hold up dude my entire script just broke for some reason probably when I was cleaning up the script to send it here...
nvm i just left lua at the start
I can wait a bit dw
its completely broke now idk what i changed
sorry for the shit gui lol im only focusing on getting ts to work atp
yh wont even unequip now nor equip the others
might just be the del old not working in this case
anyways uh its fucked
So you dont want it to dissappear when your holding it?
Yup, before it would just change but only when u triggered the proximity prompt after the first try and have problems unequipping but now it's completely broken
yeah mb gng
Replace textbutton with textlabel at the top
Shit I just noticed aha
Xd
Probably won't solve it still but that's why it wouldn't equip
I doubt it , it was the same thing before but instead of a delete function I did it manually inside
Yuh
Hmm i hate doing stuff manually
If i can code it i can
Uhh
Mode it
And does it break again or?
let me show u how it works now
Thx
The vid helped a lot
wont equip back on 2nd try and labels get created when proximity prompt is triggered instead of when equipped
and that just leads to a lot other problems eg the unequipping is now choppy ah although it doesnt work anyway
Alr so heres how to fix youre code: instead of deleting it and all that other stuff you do: make a folder indide the baby model with all the edited values
yes thats what i was thinking about doing originally
Then name every gui the exact same as every value
so i should ditch the module script?
And then v.text = datafolded:findfirstchild(v.name)
Orv.value
For now yeah but when you have more experience come back to modules
yh this is like my first time actually using them
Modules are hard to understand and all they really do is make your script look nicer
Im still not how to apply OOP to roblox studio, just a variable with multiple values right?
dude i have no idea I just learnt about making classes and metatables
im such a nub
👲
nub
noop
Im gonna learn oop rn 1 min
Alr i learned it
Lowkey dawg it aint that hard
Cant see a lot of situations where id apply this
im so bad in GUI but really shouldve stuck with this from the start... took me like 15 minutes to make the script
@digital kindle thank u vroski
Nice! Gl with your game! And if u want some fun idea (no pressure) u can add that bird that delivers babys as dropper
I actually thought of that but I'm not sure how I'd make it😂😓😓
Either way I'm focusing on functionality atm, I think this has potential ngl
Well gl with your game