Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

is it possible to associate a brick with a value ?

Asked by 5 years ago

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?

0
if tonumber(pill.Name) > value.Value then? DeceptiveCaster 3761 — 5y
0
possibly string.match if it has something besides the number in the name theking48989987 2147 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Yeah, it is possible. <pre> 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 </pre>

If this still doesn't apply to your question, give me more info so I can understand as I don't get what you are trying to say to me.

Good luck, recanman

0
I'd rather associate it with a Number Value objet because in reality , i need 5 pills (sorry for the inaccuracy) sheppard929 9 — 5y
0
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) sheppard929 9 — 5y
0
Problem fixed! works good sheppard929 9 — 5y
0
Thanks. Remember to upvote my answer! recanman 88 — 5y
Ad

Answer this question