I made a gui that you can click and changes you into another character, it works on Roblox Studio playtest but when you join the actual game on roblox website your camera is scuffed. It makes no errors so I'm confused
First here is the local script in the gui
local Characters = game:GetService("ReplicatedStorage").Characters local Event = game:GetService("ReplicatedStorage").ChooseCharacter for i,v in pairs (script.Parent:GetChildren()) do if v:IsA("TextButton") or v:IsA("ImageButton") then v.MouseButton1Click:connect(function() if Characters:FindFirstChild(v.Name) then Event:FireServer(v.Name) elseif v.Name == "PlayerCharacter" then Event:FireServer("PlayerCharacter") end end) end end
and here is the script in serverscriptservice
local Characters = game:GetService("ReplicatedStorage").Characters local Event = game:GetService("ReplicatedStorage").ChooseCharacter Event.OnServerEvent:connect(function(player,character) if character == "PlayerCharacter" then player:LoadCharacter() else local char = Characters[character]:Clone() local humapos = player.Character.HumanoidRootPart.Position char.Name = player.Name player:LoadCharacter() player.Character = char player.Character.Parent = workspace wait(.025) player.Character.HumanoidRootPart.Position = humapos end end)
here is a picture https://imgur.com/a/iPvYolF here is another picture of what its like in the game https://imgur.com/a/6Lxl6SC Please help, if you answer I will immediately accept your answer (if it works)
Hello, I am not 100% sure what's going wrong here but you can confirm the camera type is custom by having this script:
-- MAKE SURE TO PUT THIS SCRIPT IN A LOCALSCRIPT AND IN STARTERPACK!!! local Camera = workspace.CurrentCamera while true do Camera.CameraType = Enum.CameraType.Custom wait() end
This code makes sure that your camera is the default roblox camera "custom"