Tycoon make it so only the owner can buy button (help)

In your code, where it says if player == plot.plr.Value change it to if player.Name == plot.plr.Value.
After that, please show me your entire code along with the error message (in your output) if it still doesn’t work.

1 Like

Okay, now I see this.

You removed the “if”. It is supposed to be there.

1 Like

I see, fixed it. Now I get this:

Now simply add and “end” at the end of all the code. The “end” works as a closing for every part of the code such as a “for” loop or an “if” statement. Currently your for-loop is not closed because there is no “end” at the end of it.

1 Like

I did put an end, but nothing.
image

Sorry, i’m being clueless again. I think I fixed it. Is it this?

Yes, that should be it. Every part of the code is closed now :).

1 Like

Where is this script in like ServerScriptService or the model itself?

It’s in a folder.
image

Is it in the same place as the tycoon model?

1 Like

It doesn’t seem to be working, though. I think defined it wrong.

Screenshot 2022-09-30 at 21.50.17

Screenshot 2022-09-30 at 21.50.06

Screenshot 2022-09-30 at 21.50.37

yes it is, why? is that not supposed to be?

That a good thing as then you can do

local Tycoon = script.Parent.Parent.Parent -- keep doing .Parent until it is the tycoon

How does your entire hierarchy look like? Is the “Plots” model right in the Workspace or is it in some folder/model?

Then the Name would be

local Owner = Tycoon.plr

Which means change everywhere where it checks the owners name to
Owner.Value

1 Like

In the workspace

There is a model called Plots in that model are three different models called Plot1 , Plot2 , Plot3.

Then you have not defined it wrong. What is the issue anyway, do you get an error or does is just not work without giving any error message?
(Do you know how to see errors? They appear in the “Output” window)

The error I get in output is “Wrong player!”