Hello, I am Atomicold. I am relatively new to scripting and I only have one game and I am trying to make another. This is where I have a problem. I want to make a game where you choose characters that I’ve made to fight against other players, similar to how Ultimate Script Fighting and The Flash: Project Speedforce work, but I cannot figure out how I would go about beginning this process. I’ve looked both on the devforums and on YouTube but I cannot find out how I would even begin doing this. If anyone has any advice on how I could do this it would be greatly appreciated! Thank you, and have a good day!
What I mean by this is that I want to figure out how to make characters with abilities coded into them.
So if you chose the character you play as, whether it’s by Ui or via a model, you need 2 things, the character model, and the player. To do this in a UI I will list a few requirements to make things easier.
Name the button the same name as the character the button will give you
Put all the characters in a folder in replicated storage called Chars
Add a local script in the button.
First get the services we will need, the player and the character model.
Next listen for click events and make sure the model exists
After that clone the model and set the position.
Finally, destroy the old character and replace it with the custom model.
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local model = RS.Chars:FindFirstChild(script.Parent.Name)
script.Parent.MouseButton1Click:Connect(function()
if not model then error("Look at the reqs I gave") end
local char = player.Character or player.CharacterAdded:Wait()
local clone = model:Clone()
clone.Name = player.Name
clone.HumanoidRootPart.CFrame = char.PrimaryPart.CFrame
char:Destroy()
clone.Parent = game.Workspace
player.Character = clone
end)
Well I hope this helps. I hope I understood your question as this took me a while since I wrote this on mobile (so there might be a few typos). Anyways I won’t be able to help for a while now, as it is night.
I’m sorry. I didn’t realize this until now, but what I meant by this was how do I code the character with abilities? I’m really really sorry that I misspoke. I was just too tired to tell.