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

event does not want to fire?

Hello I hope you are having a blessed day but can you help me here I'm making a shotting game and I'm making a map vote system i made i sever event so if it is fired the vote get placed for that player and the hole sever sees that but it worked 100% until I made it so you can only vote 1 time here is the 2 scripts

---local script---

	DidVote = false
	 
	script.Parent.MouseButton1Click:Connect(function()
	if not DidVote then
	DidVote = true
	game.ReplicatedStorage.Mapvote1:FireServer()
	end
	end)

I just change the "Mapvote1" to mapvote2 for the next button

---sever side script---

game.ReplicatedStorage.Mapvote1.OnServerEvent:Connect(function()
	if script.Parent.Parent.Parent.Mathdone.Value == true then
	script.Parent.Parent.whatmap.Value = script.Parent.Name
	script.Parent.votevalue.Value = script.Parent.votevalue.Value +1
	else
		local map = script.Parent.Parent.whatmap.Value
		script.Parent.Parent[map].votevalue.Value = script.Parent.Parent[map].votevalue.Value -1
		script.Parent.votevalue.Value = script.Parent.votevalue.Value +1
		end
end)

the scripts are in a Image button and the image button is in a frame that is in a ScreenGui

And this thing gives me NO ERRORS

and the hole thing does not work

please help

2 comments

0

Put prints inside your server event the remote is firing but the if statements are false so its not continuing do some debug work to see which if statement is not working

0

Woah did you script this urself?

1 answer

✓ Accepted answer

Instead of using the serverscript to check if the player has voted you can do this in the localscript using a variable like i have done below.

DidVote = false

script.Parent.MouseButton1Click:Connect(function()
	if not DidVote then
	   DidVote = true
	   game:GetService('ReplicatedStorage').Mapvote1:FireServer()
	end
end)

2 comments

0

Im just ganna accept this because you helped me in my game like with team create like thank you so much

0

Np

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