Hello, when i fire client it changes to that value but when i try to click in print nil what do I do?

local rs = game:GetService("ReplicatedStorage")
local remotes = rs:WaitForChild("Remotes")

local plr = game.Players.LocalPlayer
local button = script.Parent
local frame = button:WaitForChild("Main")

local button_SizeX = button.Size.X.Scale
local button_SizeY = button.Size.Y.Scale
local buttonTweenRatio = 1.03

local debounce = false

-- UI hover animations
button.MouseEnter:Connect(function()
	button:TweenSize(UDim2.new(button_SizeX * buttonTweenRatio,0,button_SizeY*buttonTweenRatio,0),
		Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.1, true)
end)

button.MouseLeave:Connect(function()
	button:TweenSize(UDim2.new(button_SizeX,0,button_SizeY,0),
		Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.1, true)
end)

button.MouseButton1Down:Connect(function()
	button:TweenSize(UDim2.new(button_SizeX / buttonTweenRatio,0,button_SizeY/buttonTweenRatio,0),
		Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.1, true)
end)

button.MouseButton1Up:Connect(function()
	button:TweenSize(UDim2.new(button_SizeX,0,button_SizeY,0),
		Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.1, true)
end)


--------------------------------------------------------------------------------
-- PLACE
--------------------------------------------------------------------------------

local spot = nil

remotes.OpenPlaceMenu.OnClientEvent:Connect(function(name)
	spot = name
end)

button.MouseButton1Click:Connect(function()
	if debounce then return end

	local inventory = plr:WaitForChild("Inventory")
	local item = inventory:FindFirstChild(button.Name)
	if not item then return end

	debounce = true

	button.Parent.Parent:TweenPosition(
		UDim2.new(0.5, 0, 1.5, 0),
		Enum.EasingDirection.InOut,
		Enum.EasingStyle.Quad,
		0.25,
		true
	)
	
	print(spot)
	remotes.PlaceFootballer:FireServer(spot, item.Name)

	task.wait(1)
	debounce = false
end)

you gave us too little information for us to help.

1 Like

Maybe the OpenPlaceMenu event isn’t being called and setting the variables value before you click?

Here

prompt.Triggered:Connect(function(plr)
	local plotNum = plr:WaitForChild("PlotNumber").Value
	local thisPlot = tonumber(script.Parent.Parent.Parent.Name)

	if plotNum == thisPlot then
		remotes.OpenPlaceMenu:FireClient(plr, script.Parent.Name)
	end
end)

its being called, in post above i showed