no it doesnt gives an error i guess
so i have this line of code:
print(game.ReplicatedStorage.Maps:FindFirstChild(winner))
and it prints out a nil
i changed my script and it says that voting.MapVoting() is nil even when vote is ended
just make that print(winner)
and maybe add a print(mapVotes)
So can you return winner.name and then use that to find the map on the server script and then make the clone?
i cant find the map on the server script and make the clone
Alright, so hereâs the things youâve told us that are actually crucial to the problem youâre having:
- Your Main Script is within the ServerScriptService.
- Your maps are within the ReplicatedStorage.
- Youâre trying to clone a map into the workspace that resides in the ReplicatedStorage.
So, this actually should tell us what the problem is. You heard of the ServerStorage, right? You would want to put your maps in there if theyâre not going to be used by the client. The reason why is because, apparently (in strict wording from the documentation),
Scripts running in ServerScriptService may need access to various other assets which are not scripting-related, such as prefabricated models to be cloned. Such assets should go in ServerStorage.
So if youâre not going to use the maps on the client side, (which, why would you do that? and it doesnât seem like you are), put those maps in ServerStorage so that the script can access it. Otherwise, your script should run as expected. Hope this helps!
The big issue that I see is that you are handing all processing within the event handler. While you can do this, itâs causing an architectural problem When the event handler exits, where does the return go to? Nowhere.
What you want to do is define your winner outside any function so itâs in the global script context. Then you use the event handler to manipulate it per your events. When the timer runs out, then check the list to see which map won the vote.
So i fixed my problem thanks to people that tried to help me
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.