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

Turn this script into a click to morph?

Asked by 6 years ago

I would really appreciate if someone could help me out with turning this touch to morph script, into a click to morph script.

01function onTouched(hit)
02    if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("HandLeft") == nil then
03        local g = script.Parent.Parent.HandLeft:clone()
04        g.Parent = hit.Parent
05        local C = g:GetChildren()
06        for i=1, #C do
07            if C[i].className == "Part" or "MeshPart" then
08                local W = Instance.new("Weld")
09                W.Part0 = g.Middle
10                W.Part1 = C[i]
11                local CJ = CFrame.new(g.Middle.Position)
12                local C0 = g.Middle.CFrame:inverse()*CJ
13                local C1 = C[i].CFrame:inverse()*CJ
14                W.C0 = C0
15                W.C1 = C1
View all 34 lines...

1 answer

Log in to vote
1
Answered by 6 years ago

Instead of using touched:connect, add a click detector into the morph. Then you want to say script.Parent.ClickDetector.MouseClick:connect

0
What would I change the "hit" to? felonymartinez 12 — 6y
0
MouseClick returns the player. unmiss 337 — 6y
Ad

Answer this question