-
I have a model from replicated storage and when the player gets the model, it is supposed to appear on the player’s left arm.
-
When the player gets the model, I use a weld constraint to make the model appear on the left arm. But it doesn’t appear on the arm. But when I view from the server side, I can see the model. But locally, the model doesn’t appear on the player’s arm.
-
I have tried using a motor6D instead of the weld constraint, but it didn’t do anything. I also tried using the roblox assistant but they weren’t helpful, as usual. I’m not sure what to do, but I will leave the first person local script and the script connecting the model to the player.
First Person Script, A local script under StarterCharacterScripts
local player = game.Players.LocalPlayer
local char = player.Character
local RunService = game:GetService("RunService")
--char.Humanoid.CameraOffset = Vector3.new(0, 0, -1)
for i, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "Head" then
v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
v.LocalTransparencyModifier = v.Transparency
end)
v.LocalTransparencyModifier = v.Transparency
end
end
RunService.RenderStepped:Connect(function(step)
local ray = Ray.new(char.Head.Position, ((char.Head.CFrame + char.Head.CFrame.LookVector * 2) - char.Head.Position).Position.Unit)
local ignoreList = char:GetChildren()
local hit, pos = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)
if hit then
--char.Humanoid.CameraOffset = Vector3.new(0, 0, -(char.Head.Position - pos).magnitude)
else
char.Humanoid.CameraOffset = Vector3.new(0, 0, -1)
end
end)
The Script that connects the Model to the Player’s Left Arm. It is under ServerScriptService
local players = game:GetService("Players")
local gotAshley = game.ReplicatedStorage.PlayerData.GotAshley
local gotAshleyEvent = game.ReplicatedStorage.PlayerTalk.GotAshleyEvent
gotAshleyEvent.OnServerEvent:Connect(function(player)
gotAshley.Value = true
local Char = player.Character
local LeftArm = Char:WaitForChild("Left Arm")
local ArmDisplay = game.ReplicatedStorage.ASHLEY:Clone()
ArmDisplay.Parent = LeftArm
local Studs = CFrame.new(0.1,-0.45,0)
local Angle = CFrame.Angles(math.rad(90),math.rad(90),math.rad(180))
ArmDisplay:SetPrimaryPartCFrame(LeftArm.CFrame * Studs * Angle)
local Weld = Instance.new("WeldConstraint", LeftArm)
Weld.Part0 = LeftArm
Weld.Part1 = ArmDisplay.PrimaryPart
end)