So, I created a topic on this already, but it didn’t get answered like I thought it would be.
Basically, take any FPS game with a menu. Arsenal for example has a menu with GUI buttons.
So you can’t load a character when you press a gui button without a remote.
And I don’t know how to use remotes.
A simple way of doing what is needed would be to add a RemoteEvent into ReplicatedStorage and to make the Button fire the RemoteEvent when the user presses on the button, something like this
local button = script.Parent
local remote = game:GetService("ReplicatedStorage").RemoteEvent
button.MouseButton1Up:Connect(function()
remote:FireServer()
end)
But in your RemoteEvent, you need some code to load the character, we can simply use the first parameter that is given automatically, the player who fired the event and load their character!
local remote = game:GetService("ReplicatedStorage").RemoteEvent
remote.OnServerEvent:Connect(function(plr)
plr:LoadCharacter()
end)
This is a very basically way of doing it which can also help you grasp some Remote knowledge, as it teaches you a few good things to know, suhc as how the first parameter of OnServerEvent is always the player who fired the event and that the FireServer gives it automatically so you do not need to fire it yourself
Although I still recommend reading articles and guides as well to help you out even more in understandign them
It’s actually pretty simple when you think about it
RemoteEvents are basically the transportation from 1 side to another (Or in your instance, firing from the client to the server)
If we wanna load the Character on the server side, we could simply just reference the RemoteEvent inside ReplicatedStorage (Hence the name, “Replicated” Storage or able to replicate across both sides) in both a Local & Server Script, where the Local will be parented inside the Button, and the Server will be parented inside ServerScriptService
Okay, Thanks! I would mark both of your (jack and embat) answers as solution but I can only do one. Since embat is a bit more clear, he gets solution. (Also embat, a few typos)