Hello! I'm new here. I currently have a problem about spawning as a random character and role, something like in Vampire Hunters and Murder Mystery combined together. For example, you spawn as Jackson Wang as the Killer or the Detective. Can someone tell me the script for this?
COMMUNITY QUESTION
How do I spawn as a random character?
2 answers
This is not a request website, so noone will write a script for you. Try to make it yourself and if you run into any trouble come back with the code and someone will certainly help you.
Store all the characters in a certain area. (I suggest a folder in ServerStorage named Player Assets in another folder named Characters)
local Characters = game:GetService("ServerStorage"):WaitForChild("Player Assets"):WaitForChild("Characters"):GetChildren() do
local function randomCharacter()
return Characters[math.random(1, #Characters)]
end
local newCharacter = randomCharacter()
Now all you have to do is morph the old character to the new one.
This discussion is preserved as it was. New answers, comments, and votes are closed.
