DevUndead
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 558 |
|
|
| 15 Aug 2015 07:19 PM |
| I need some src, or a method of how I can make a NON-TOOL dragger function. This is for placing objects found in a survival game. Cheers |
|
|
| Report Abuse |
|
awotn
|
  |
| Joined: 01 Nov 2014 |
| Total Posts: 226 |
|
|
| 15 Aug 2015 07:23 PM |
posted this one on your other post.
took me a few mins
local Player = game.Players.LocalPlayer local Character = Player.Character local Mouse = Player:GetMouse() local Camera = workspace.CurrentCamera
local UIS = game:GetService('UserInputService')
local Object = nil
UIS.InputBegan:connect(function(Input) if Input.KeyCode == Enum.KeyCode.Q and Object == nil then -- insert obj into cam Object = Instance.new('Part', Camera) Object.Anchored = true Mouse.TargetFilter = Object elseif Input.KeyCode == Enum.KeyCode.E and Object ~= nil then -- set obj in workspace local Subject = Object:clone() Subject.Parent = workspace Subject.CFrame = Object.CFrame Object:Destroy() Object = nil Mouse.TargetFilter = nil elseif Input.KeyCode == Enum.KeyCode.Q and Object == nil then -- delete obj Object:Destroy() Object = nil Mouse.TargetFilter = nil end end)
game:GetService('RunService').RenderStepped:connect(function() if Object ~= nil then Object.CFrame = CFrame.new(Mouse.Hit.p) * CFrame.new(0, Object.Size.Y/2, 0) end end) |
|
|
| Report Abuse |
|