Where do i need to put MouseButton1Click?

local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local RemoteEvent = Remotes:WaitForChild("DoubleMoneyGainEvent")

local screenGUI = script.Parent
local GuiHolder = screenGUI.GuiHolder
local UpgradesHolder = GuiHolder.UpgradesHolder
local StatsHolder = GuiHolder.StatsHolder
local DoubleMoneyGainButton = UpgradesHolder.DoubleMoney.UpgradeButton

	local Money = player.stats:FindFirstChild("Money")
	local Multi = player.stats:FindFirstChild("Multi")
	local NumberOfUpgrades = DoubleMoneyGainButton.NumberOfUpgrades
	if NumberOfUpgrades.Value == 0 and Money.Value >= 5 then
		Money.Value -= 5
		Multi.Value *= 2
		NumberOfUpgrades.Value += 1

You should put it in a LocalScript parented under the Button.

So the code would be:



What are you tryna achieve?

1 Like

You should delete the screengui variables because they only work in local scripts or put it in the remote event.

What do you mean? Also, why are you looking for a server event in a server that is clearly local