Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Using the IntValue Object in parts to store int numbers?

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

2 comments

0

Can you organize your question a bit more? Give a direct explanation of what you want done

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.

1 answer

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.

2 comments

0

Thanks, i solved it. Now i'm having issues with the random numbers always getting the same

0

math.randomseed() for the most part will give you the same results unless you set the argument to tick()

This discussion is preserved as it was. New answers, comments, and votes are closed.