Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i connect click detectors with primary part cframe?

I am trying to animate a model with cframe using setprimary part and I have no idea how to connect the script with clickdetectors.

1 answer

✓ Accepted answer

I'm not great at this sort of thing, but, you could try something along the lines of:

script.Parent.ClickDetector.MouseClick:Connect(function()
local modelname = game.Workspace:FindFirstChild("INSERTNAMEHERE")
local pos = modelname.PrimaryPart.CFrame = CFrame.new(0, 0, 0) --insert position here
modelname:SetPrimaryPartCFrame(pos) --sets the position stated in variable pos
end)

I'm not sure wether this is what you where looking for, would be helpful if you attached the script that you currently have.

This discussion is preserved as it was. New answers, comments, and votes are closed.