How do I actually implement an ontouched function (player touch register) into a modulescript?

Is the button script enabled or disabled in-game?

It’s enabled. Apologies If I’m being overly vague with adressing this issue.

1 Like

Hmm, that’s weird. Is the configuration file inside the Button folder?

Yes essentially the folder is stored within the model; just because you might need more context of the overall heirarchy of my tycoon buttons this is essentially what it is (the text gui is just a hovering gui billboard for the buttons to explain what the player is buying when they do decide to walk over it):
image

edit for context: the error I’m getting is only showing up when I playtest and step on the button (i.e, executing the function from the button script). I don’t get any errors before

I think it’s because the Configuration is in a different folder, I’ll try to think of a solution for this.

(bump)

This is the variable that is erroring for anyone who can help solve this:

local price = script.Parent.Parent.Configuration.Price.Value

I expected that when the function is called by ButtonScript and these variables are executed within said function, “script” would be ButtonScript, not ButtonModule which is what I displayed earlier in the thread. I want the variables to be referenced correctly from ButtonScript and not ButtonModule when it’s being called/executed by ButtonScript but how do I go about doing this?