How would i start about creating a viewmodel for a fps game?, kinda like the view models town uses. (like how it uses a replica of the character’s arms)
(Edit, 11/12/22)
Could still use some help on this, as the way im going i dont think this is going to end up too well
What i currently got
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
Character.Archivable = true
repeat task.wait() until game:IsLoaded()
local sf = string.find
local viewmodel = Instance.new("Model")
viewmodel.Name = "ViewModel"
local ClonedChar = Character:Clone()
for Num, Part in ipairs(ClonedChar:GetChildren()) do
local name = Part.Name:lower()
if not sf(name, "hand") and not sf(name, "arm") and not sf(name, "head") then
if not Part:IsA("Humanoid") and not Part:IsA("Shirt") then
Part:Destroy()
elseif Part:IsA("Humanoid") then
Part.Parent = viewmodel
for i, v in ipairs(Part:GetChildren()) do
if not v:IsA("Animator") then v:Destroy()end
end
else
Part.Parent = viewmodel
end
else
if not Part:IsA("MeshPart") then
Part:Destroy()
else
Part.Anchored = true
Part:ClearAllChildren()
Part.Parent = viewmodel
end
end
end
ClonedChar:Destroy()
viewmodel.Parent = workspace.Camera
local CameraPart = Instance.new("Part"); CameraPart.Name = "CameraPart"
CameraPart.Anchored = true
CameraPart.CanCollide = false
CameraPart.Size = Vector3.new(.75,.75,.75)
CameraPart.Parent = viewmodel
CameraPart.CFrame = viewmodel:WaitForChild("Head").CFrame
viewmodel:WaitForChild("Head"):Destroy()