i have a server script sending a clientevent to the local player. in play mode everything works perfectly. but in multiplayer it comes up with this error
attempt to index global 'button' (a nil value)
Before you say that "Nil means that it doesnt exist" it does exist, like i said it works in play mode so if it is working in play mode, it means the variable does exist, doesnt it?
Heres the server script
function clicked(player, button)
local Button = button
game.ReplicatedStorage.Remotes.PlayerCrateClick:FireClient(player,Button)
end
game.ReplicatedStorage.Remotes.CrateClick.OnServerEvent:Connect(clicked)
Heres the function in a local script
function clicked(Button)
button = Button
button.Parent.BackgroundColor3 = Color3.new(115/255,115/255,115/255)
openbutton.Visible = true
openbutton:TweenSize(UDim2.new(0, 200, 0, 70), "Out", "Bounce", 1)
end

5 comments
when did you fire the server in the local script?
https://forum.scriptinghelpers.org/topic/193/color3s-are-not-rgbs
why don't you just do function clicked(button) instead of function clicked(Button) then button = Button????? and use Color3.fromRGB
Im not talking about color3s, okay ignore that... @abnotaddable i did that but im still getting the same error..
@abnotaddable i put the button = Button thing because i need to use the same variable around the whole script...