Make the server run the :LoadCharacter() function rather then client, because :LoadCharacter() on a local script will throw an error.
There is not a functional way.
If you want to do something about like that use a RemoteEvent.
http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent
http://wiki.roblox.com/index.php?title=API:Class/Player/LoadCharacter
http://prntscr.com/ajzjag
(This method will work with FE)
[!!!]: IF YOU ENCOUNTER ANY ERRORS MESSAGE ME :[!!!]
-- SERVER --
wait()
local event = Instance.new("RemoteEvent", game:GetService("ReplicatedStorage"))
event.Name = "RespawnEvent"
event.OnServerEvent:connect(function(Player, _)
if Player then
Player:LoadCharacter()
end
end)
-- LOCAL --
wait()
local event = game:GetService("ReplicatedStorage"):WaitForChild("RespawnEvent")
local LocalPlayer = game:GetService("Players").LocalPlayer
function onClicked()
LocalPlayer.TeamColor = BrickColor.new("Bright blue")
event:FireServer("Respawn")
end
script.Parent.MouseButton1Click:connect(onClicked)
2 comments
Alright, I got it. Thanks!
If this helped you please accept my answer! :D