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

Using the IntValue Object in parts to store int numbers?

Asked by 8 years ago
Edited 8 years ago

I'm working on a new Tycoon style of game (not the usual boring stuff) and i need a script that access to that IntValue object and changes the number, so far i just came up to this but seems it doesn't work

My idea is to create random parts with an IntValue file which stores a value, so far i could create instances which creates the part and the IntValue file in it. But i don't know how to give that IntValue file a random number to store when the part is created and the file in it too.

Thanks for read

0
Can you organize your question a bit more? Give a direct explanation of what you want done DepressionSensei 315 — 8y
0
I created instances which creates a Part with an IntValue object in it when the game loads, but i can't get to work to put a number value in IntValue via script when the game loads. jonathan3576 12 — 8y

1 answer

Log in to vote
0
Answered by
FiredDusk 1466 Moderation Voter
8 years ago

I am not too sure what you are wanting but this is what I though you wanted.

--First off, find the part value.

TheValue.Value = math.random(1,5) --This gives a value 1 - 5.
0
Thanks, i solved it. Now i'm having issues with the random numbers always getting the same jonathan3576 12 — 8y
0
math.randomseed() for the most part will give you the same results unless you set the argument to tick() DepressionSensei 315 — 8y
Ad

Answer this question