Jump to content

[Help Needed] Different examination quotes depending on state of prefab


Recommended Posts

So is this grass that you can be picked at different growing stages and for these you need different examination quotes?

Or do you want multiple possible quotes that can be said when the prefab is picked?

Or do you want different quotes for different characters?

  • Like 1
Link to comment
Share on other sites

6 hours ago, Monti18 said:

So is this grass that you can be picked at different growing stages and for these you need different examination quotes?

Or do you want multiple possible quotes that can be said when the prefab is picked?

Or do you want different quotes for different characters?

Multiple possible quotes that can be said when the prefab is picked.

Link to comment
Share on other sites

I think you can use SetDescription of the component inspectable.

local string = {"string1","string2","string3"}

local function description()
  return string[math.random(#string)]
end

--master postinit
inst.components.inspectable:SetDescription(description)

Add this to your item prefab.

I think something like this should return a random string of the table string each time you inspect it.

Try if it works.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...