With the script, I've been able to create the dragging motion as well as placing down the model clone. I don't know how to make it visible for only one player. Does it have to do with something with a player's tool? Or does it affect the player's Camera script?

Here is the code:

a = script.Parent -- 1
b = a.Parent -- 2
c = b.Parent -- 3
d = c.Parent -- 4
plr = d

function checkPressed(btn)
	a.MouseButton1Down:wait() 
	mouse = game.Players.LocalPlayer:GetMouse()
	clone = game.Lighting.Mini1:Clone()
	wait()
	mouse.TargetFilter = clone
	clone.Parent = game.Workspace -- I know this is where you would create a parent for the model but I don't know what to put here.
	dragging = true --sets dragging to true
	wait()
	while dragging do --set position until...
		wait()
		clone:MoveTo(Vector3.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z))
		wait()
		mouse.Button1Down:connect(--mouse down
		function() 
			dragging = false --sets dragging to false
			clone.Parent = workspace
			for i, v in pairs(clone:GetChildren()) do
    			if v:IsA("BasePart") or v:IsA("UnionOperation") then
       				v.Transparency = 0
					v.CanCollide = true
    			end
			end
			drg = true
			while drg do
				wait()
				mouse.Button1Up:connect(function()
					mouse.TargetFilter = nil
					drg = false
				end
				)
			end
		end
		)
	end
end
spawn(checkPressed)

4 comments

1

Looks like you should be using a Local Script, so just turn on Filtering Enabled.

0

yeah, use FE for local parts

0

Your best option is to use filtering enabled. Another option which may not be as good would be to parent that model to the player's camera. Placing something in the camera does not do anything towards preventing script kiddies from exploiting in a game. Learning FE will.