Tycoon, Same plot all players, buttons only work for themself

Hello,

I am currently trying to make a tycoon, where all the players are on the same exact map and building the same exact things.
So whenever someone buys something it only appears for them not the other people.
Thats what im trying to make, but.

I have tried many scripts, tutorials, but nothing worked.
I dont know how to fix this. I really need help. I have been trying for hours now but i dont know how to do this.

Can someone help me please?

here is a script i quickly made, it works but when 1 player buys it the others see it, which i do not want.

local Items = game.Workspace.Items

script.Parent.Touched:Connect(function(touched)
	local humanoid = touched.Parent:WaitForChild("Humanoid")
	if humanoid then
		script.Parent.Transparency = 1
		Items.Flooring.Transparency = 0
	end
end)

Are you using local scripts? Local scripts are for client side only which would mean only for one player or the local player.

But whenever someone buys something it only appears for them not the other people

Isn’t that what you would want for a tycoon game? Otherwise I’m understanding it wrong

this sounds like an issue of using local scripts

i am still trying to make some scripts, if i make one i can send it here so you can check what is wrong

Are you using local scripts? If you want everyone to make a tycoon at once (like a big tycoon if that’s what your looking for) use scripts, not local ones.

As others have said, if you only want the player to see it, use a LocalScript. LocalScripts run on the user’s device only and therefore do not affect other player’s view and what they see in-game. It seems you’re using a regular Script, which runs on the game server and replicates all changes to all players.

when i use a local script, it does not work, only script works.

I have also udpdated my script, here it is.
it only works with a script, but i need it in a Localscript:

Model = game.Workspace.Items.Flooring
Upgradecost = 0
upgradeStuff = Model:clone()

wait(1)

Model:remove()
local ting = 0

function onTouched(hit)
	if ting == 0 then
		ting = 1
		check = hit.Parent:FindFirstChild("Humanoid")

		if check ~= nil then
			local user = game.Players:GetPlayerFromCharacter(hit.Parent)
			local stats = user:findFirstChild("leaderstats")

			if stats ~= nil then
				local rbx = stats:findFirstChild("RBX")
				if rbx.Value > (Upgradecost-1) then

					rbx.Value = rbx.Value - Upgradecost
					upgradeStuff.Parent = script.Parent.Parent.Parent
					script.Parent.Parent:remove()

				end
			end
		end
	end

	ting = 0
end

script.Parent.Touched:connect(onTouched)