I tried many ways… but the server will never return the “true” and the localscript is stuck waiting for it
Local Script:
script.Parent.MouseButton1Click:Connect(function()
local dds = game.ReplicatedStorage.Effects.SpawnCharacter:InvokeServer(game.StarterPlayer.StarterCharacter,game.Players.LocalPlayer.Team)
print(dds)
workspace.Camera.CameraType = Enum.CameraType.Custom
end)
Server Script:
game.ReplicatedStorage.Effects.SpawnCharacter.OnServerInvoke = function(plr,char,team)
print("gottem")
plr.Character:Destroy()
local newchar = char:Clone()
newchar.Parent = workspace
plr.Character = newchar
for i,v in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
local inst = v:Clone()
inst.Parent = newchar
end
print("HOLDING")
if team == game:GetService("Teams").Left then
newchar.PrimaryPart.CFrame = workspace.SpawnsBox.LeftSpawn.CFrame
elseif team == game:GetService("Teams").Right then
newchar.PrimaryPart.CFrame = workspace.SpawnsBox.RightSpawn.CFrame
end
print("THE END")
return true
end