-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPossessToolModified
More file actions
57 lines (51 loc) · 1.55 KB
/
PossessToolModified
File metadata and controls
57 lines (51 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-- POSSESS TOOL (MODIFIED!!!)
-- Works on any humanoid
-- Only if you're the network owner
local lp = game:GetService("Players").LocalPlayer
local mouse = lp:GetMouse()
local tool
local function main(char)
if tool and tool.Parent then return tool end
local possessed = false
tool = Instance.new("Tool")
tool.Name = "Possess"
tool.ToolTip = "Possess some character by clicking on them."
tool.RequiresHandle = false
tool.Activated:Connect(function()
local trg = mouse.Target
while trg~=workspace or trg~=game or trg~=nil do
trg=trg.Parent
if trg:IsA("Model") and trg:FindFirstChildOfClass("Humanoid") then
possessed = true
tool.Name = "Unpossess"
tool.ToolTip = "Equip to unpossess."
tool.Parent = lp.Backpack
lp.Character = trg
workspace.CurrentCamera.CameraSubject = trg:FindFirstChildOfClass("Humanoid")
if char:FindFirstChild("Animate") and not trg:FindFirstChild("Animate") then
char.Animate:Clone().Parent = trg
end
while possessed do
local hrp=char.Humanoid.RootPart;hrp.CFrame = trg.Humanoid.RootPart.CFrame:ToWorldSpace(CFrame.new(0,-6,1.3))
hrp.Velocity = Vector3.zero
task.wait(0.01)
end
return
end
end
end)
tool.Equipped:Connect(function()
if possessed then
possessed = false
tool.Name = "Possess"
tool.ToolTip = "Possess some character by clicking on them."
tool.Parent = lp.Backpack
lp.Character = char
workspace.CurrentCamera.CameraSubject = char:FindFirstChildOfClass("Humanoid")
end
end)
tool.Parent = lp:WaitForChild("Backpack")
return tool
end
lp.CharacterAdded:Connect(main)
pcall(main,lp.Character)