Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Vote system with filter enabled?

Making a vote gui on my game, having problem sending the votes to the players tho', it gives me "Unable to cast value to Object" can anybody help?

	for i,v in pairs(game.Players:GetChildren()) do
		game.Players[v].Votes:FireClient(Vote1,Vote2,Vote3) -- problem
	end

2 comments

0

You can use FireAllClients, since that's what you want to do.

0

Never learnt how to use FireAllClients. Care to explain?

1 answer

✓ Accepted answer

When firing to the client, the first argument is ALWAYS the Player (instance). To fix up your code:


for i,v in pairs(game.Players:GetChildren()) do
    v.Votes:FireClient(v,Vote1,Vote2,Vote3) -- I do hope "Votes" is a RemoteEvent
end

4 comments

0

Yep I think that works, thanks,

0

game.Players[v] is definitely not right.

0

Sorry dad, only focused on the other part.

0

Ye I already fixed the proble,.

This discussion is preserved as it was. New answers, comments, and votes are closed.