Hello, I was wondering if it is possible to associate a value to bricks, I explain myself
let's imagine a pill 1 and 2, and a value on 2 if I remove 1 from my value, the pill disappears and vice versa
is it possible?
Hello, I was wondering if it is possible to associate a value to bricks, I explain myself
let's imagine a pill 1 and 2, and a value on 2 if I remove 1 from my value, the pill disappears and vice versa
is it possible?
Yeah, it is possible.
local pill1 = PATH OF PILL (e.g workspace.Model.Pill1) local pill2 = PATH OF PILL (e.g workspace.Model.Pill2) local pill3 = PATH OF PILL (e.g workspace.Model.Pill3) local pill4 = PATH OF PILL (e.g workspace.Model.Pill4) local pill5 = PATH OF PILL (e.g workspace.Model.Pill5) local pill_Int1 = toNumber(pill1.Name) - NUMBER local pill_Int2 = toNumber(pill2.Name) - NUMBER local pill_Int3 = toNumber(pill3.Name) - NUMBER local pill_Int4 = toNumber(pill4.Name) - NUMBER local pill_Int5 = toNumber(pill5.Name) - NUMBER if pill_Int1 < pill_Int2 then pill1:Destroy() -- Bye-bye pill 1 if pill_Int2 < pill_Int3 then pill1:Destroy() -- Bye-bye pill 2 if pill_Int3 < pill_Int4 then pill1:Destroy() -- Bye-bye pill 3 if pill_Int4 < pill_Int5 then pill1:Destroy() -- Bye-bye pill 4 if pill_Int5 < 6 then pill1:Destroy() -- Bye-bye pill 5
Good luck, recanman
I'd rather associate it with a Number Value objet because in reality , i need 5 pills (sorry for the inaccuracy)
I tried a little script based on your proposal but I end up with this: 00:05:30.320 - Workspace.bricks.Script:2: ')' expected near 'script' LINE 1 local pill1 = script.Parent.pill1 (e.g script.Parent.pill1)
Problem fixed! works good
Thanks. Remember to upvote my answer!
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
if tonumber(pill.Name) > value.Value then?
possibly string.match if it has something besides the number in the name