So I have a script that is a voting system I’m working on for choosing topics and for some reason the client clearly shows that an object exists but whenever I pass it through a remote event it prints nil?
Client Script:
button.MouseButton1Click:Connect(function()
print(button)
VoteButtonEvent:FireServer(button)
end)
Rs.ChangeVoteText.OnClientEvent:Connect(function(buttonName)
print(buttonName)
if buttonName == script.Parent then
VoteInt.Value += 1
text.Text = tostring(VoteInt.Value)
end
end)
Prints the instance the first time then prints nil
Warning user your code is a crimethink against Ministry of Luau please submit reeducation report.
Crimethink against ministry of server is ungood.
button is unpersoned and never ever existed you cannot access it.
I also noticed on the OnClientEvent function that it checks if the ButtonName is equal to the script’s parent which will always be false. Instead, it should be if buttonName == script.Parent.Name
Thank you! this ended up working but I was a bit confused cause I had tried to do that right before I made it to an instance instead but I fixed a few other things that were wrong so thats probably why .