Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I spawn as a random character? [closed]

Asked by 5 years ago

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?

Closed as Not Constructive by User#21908, User#19524, brokenVectors, and jackfrost178

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
2
Answered by 5 years ago

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.

Ad
Log in to vote
0
Answered by 5 years ago

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.