Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Model not moving to part's position. Why?

Asked by 5 years ago

Ok so i pretty much want to move a model to a certain position in this case the players LeftLowerArm so i did this but it didn't work can someone explain why to me?

--Client
local uis = game:GetService("UserInputService")

uis.InputBegan:Connect(function(input,gameProcessedEvent)
    if input.UserInputType == Enum.UserInputType.Keyboard then
        if input.KeyCode == Enum.KeyCode.G and not gameProcessedEvent then
            script.Parent.Remotes.Equip:FireServer()    
        end 
    end
end)
--Server
script.Remotes.Equip.OnServerEvent:Connect(function(plr)
    local g = script.Gauntlet:WaitForChild("Thanos"):Clone()
    local c = plr.Character
    g.Parent = plr.Character
g.LeftLowerArm.PlayerWeld.Part1 = c.LeftLowerArm

        c.LeftHand.Transparency = 1
    g.LeftLowerArm:TranslateBy(c.LeftLowerArm.Position-g.LeftLowerArm:GetModelCFrame().p)
        for _, x in next, g:GetChildren() do
    local Match = c:FindFirstChild(x.Name)
    if (Match) then
        x:SetPrimaryPartCFrame(Match.CFrame)
    end
    end
end)

0
I didnt clarify that these are two different scripts Instance_Brick 12 — 5y
0
take it step by step. see if the remote is firing to the server. after that, see if the gauntlet clone and character exist / gauntlet gets parented into the player. tell me when it stops working as expected royaltoe 5144 — 5y
0
It is firing and it is in the player so i dont see what is wrong   Instance_Brick 12 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

I figured out a fix by just adding the welds after the model moves to the set position thank you for trying to help me!

Ad

Answer this question