Can someone help?Since I'm trying to make a viewmodels and randomly this error popped up
Error:
20:06:58.185 - Players.wiktormont.Backpack.Tool.LocalScript:11: attempt to call field 'Name' (a string value)
20:06:58.187 - Stack Begin
20:06:58.200 - Script 'Players.wiktormont.Backpack.Tool.LocalScript', Line 11
20:06:58.201 - Stack End
Script:
local Cam = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local ReplicatedS = game.ReplicatedStorage
local Mouse = player:GetMouse()
local Tool = script.Parent
local RunService = game:GetService("RunService")
local V_Model = "V_" ..Tool.Name ""
for i,v in pairs (ReplicatedS.V_Model:GetChildren()) do
if v:IsA("BasePart") then
if v ~= V_Model.PrimaryPart then
local Weld = Instance.new("Weld")
Weld.Part0 = V_Model.PrimaryPart
Weld.Part1 = v
Weld.C0 = V_Model.PrimaryPart.CFrame:inverse()
Weld.Name = v.Name
Weld.Parent = V_Model.PrimaryPart
end
end
end
Tool.Equipped:Connect(function(Mouse)
V_Model.Parent = Cam
RunService.RenderStepped:Connect(function()
V_Model:SetPrimaryPartCFrame(Cam.CFrame * CFrame.new(0,-1.5,1.5))
end)
end)

3 comments
Fixes the error but the problem is that it doesn't show for some Reason
bad code
what