Just a reminder, I have found solutions on Google, and they say to make a local script fire a RemoteEvent to a server, to then run :LoadCharacter(), but for some annoying reason it doesn’t work:
Client:
local RS = game:GetService("ReplicatedStorage")
local RSEvents = RS:WaitForChild("Events")
local EventsL = RSEvents:WaitForChild("Loaded")
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
EventsL:FireServer()
This is quite literally meant to work. It fires the RemoteEvent immediately after joining the game, and it’s meant to then load the character in that RemoteEvent. What the hell is wrong?!
If you have any suggestions or solutions, please reply down below. Thank you.
I also put print() after the :FireServer() line and it never printed. It’s something in the local script that’s yielding, but it’s not the RemoteEvents with the :WaitForChild().
I also tried running this code in the Roblox Studio console, and it works. Something is definitely yielding.
game.ReplicatedStorage.Events.Loaded:FireServer()
--does work in console
local RS = game:GetService("ReplicatedStorage")
local RSEvents = RS:WaitForChild("Events")
local EventsL = RSEvents:WaitForChild("Loaded")
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
game:GetService("Players").PlayerAdded:Connect(function(plr)
task.wait(0.5)
EventsL:FireServer()
end)
Put the script that receives the event inside of ServerScriptService as a ServerScript
Put the script that sends the event inside of StarterPlayerScripts
Check that the event is actually being fired i saw that you said your firing the event when pressing a button check the code that detects when you click the button or place a print statement in the server scripts event function to check if it is being ran
i used the code from the original post and it works just fine it is a problem with either where u have placed your scripts or the function that EventsL:FireServer() is being fired in
I doubt there is anything wrong with your Roblox Studio check the client script is where it is placed in the image, client code will not run outside of StarterPlayerScripts if there is no character appended to the player