View difference between Paste ID: nC26hJcJ and N9TKpWi5
SHOW: | | - or go back to the newest paste.
1
-- This script has been converted to FE by StarzoZero
2
3
4
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
6
do
7
	print("FE Compatibility code by StarzoZero")
8
	print("ERR.!? GH0ST L0AD3D.?!")
9
	script.Parent = Player.Character
10
11
	--RemoteEvent for communicating
12
	local Event = Instance.new("RemoteEvent")
13
	Event.Name = "UserInput_Event"
14
15
	--Fake event to make stuff like Mouse.KeyDown work
16
	local function fakeEvent()
17
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
18
		t.connect = t.Connect
19
		return t
20
	end
21
22
	--Creating fake input objects with fake variables
23
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
24
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
25
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
26
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
27
	end}
28
	--Merged 2 functions into one by checking amount of arguments
29
	CAS.UnbindAction = CAS.BindAction
30
31
	--This function will trigger the events that have been :Connect()'ed
32
	local function te(self,ev,...)
33
		local t = m[ev]
34
		if t and t._fakeEvent and t.Function then
35
			t.Function(...)
36
		end
37
	end
38
	m.TrigEvent = te
39
	UIS.TrigEvent = te
40
41
	Event.OnServerEvent:Connect(function(plr,io)
42
	    if plr~=Player then return end
43
		if io.isMouse then
44
			m.Target = io.Target
45
			m.Hit = io.Hit
46
		else
47
			local b = io.UserInputState == Enum.UserInputState.Begin
48
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
49
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
50
			end
51
			for _,t in pairs(CAS.Actions) do
52
				for _,k in pairs(t.Keys) do
53
					if k==io.KeyCode then
54
						t.Function(t.Name,io.UserInputState,io)
55
					end
56
				end
57
			end
58
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
59
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
60
	    end
61
	end)
62
	Event.Parent = NLS([==[
63
	local Player = game:GetService("Players").LocalPlayer
64
	local Event = script:WaitForChild("UserInput_Event")
65
66
	local UIS = game:GetService("UserInputService")
67
	local input = function(io,a)
68
		if a then return end
69
		--Since InputObject is a client-side instance, we create and pass table instead
70
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
71
	end
72
	UIS.InputBegan:Connect(input)
73
	UIS.InputEnded:Connect(input)
74
75
	local Mouse = Player:GetMouse()
76
	local h,t
77
	--Give the server mouse data 30 times every second, but only if the values changed
78
	--If player is not moving their mouse, client won't fire events
79
	while wait(1/30) do
80
		if h~=Mouse.Hit or t~=Mouse.Target then
81
			h,t=Mouse.Hit,Mouse.Target
82
			Event:FireServer({isMouse=true,Target=t,Hit=h})
83
		end
84
	end]==],Player.Character)
85
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
86
end
87
88-
plr = game.Players.StarzoZero
88+
plr = game.Players.silver22352
89
part = nil
90
bp = nil
91
particles = nil
92
function clerp(a,b,c,d)
93
	for i = 0,d,.01 do
94
		a.CFrame = CFrame.new(b:lerp(c,i))
95
		wait()
96
	end
97
end
98
function slerp(a2,b2,c2,d2)
99
	for i2 = 0,d2,.01 do
100
		a2.CFrame = CFrame.new(b2:lerp(c2,i2))
101
		wait()
102
	end
103
end
104
mouse.KeyDown:connect(function(key)
105
	if key == "e" and plr.Character.Parent == workspace then
106
		plr.Character.Parent = workspace.Camera
107
		plr.Character.Archivable = true
108
		Instance.new("ForceField",plr.Character).Visible = false
109
		for y,t in pairs(plr.Character:GetChildren()) do
110
			if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
111
				t.Transparency = 1
112
				if t.Name == "Head" and t:FindFirstChild("face") then
113
					t.face.Transparency = 1
114
				end
115
			elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
116
				t.Handle.Transparency = 1
117
			end
118
		end
119
	elseif key == "z" and plr.Character.Parent == workspace.Camera and part == nil then
120
		plr.Character.Torso.CFrame = CFrame.new(Vector3.new(mouse.hit.p.X,mouse.hit.p.Y+1.5,mouse.hit.p.Z),plr.Character.Torso.CFrame.p)
121
	elseif key == "x" and plr.Character.Parent == workspace.Camera and part == nil then
122
		if plr.Character.Torso.Anchored == true then
123
			for y,t in pairs(plr.Character:GetChildren()) do
124
				if t:IsA("Part") then
125
					t.Anchored = false
126
				end
127
			end
128
		else
129
			for y,t in pairs(plr.Character:GetChildren()) do
130
				if t:IsA("Part") then
131
					t.Anchored = true
132
				end
133
			end
134
		end
135
	elseif key == "c" and plr.Character.Parent == workspace.Camera and part ~= nil then
136
		local clone = part:Clone()
137
		clone.Parent = workspace
138
		clone.Anchored = false
139
		clone:ClearAllChildren()
140
		clone.CanCollide = true
141
		bp.Parent = clone
142
		particles.Parent = clone
143
		if part.Parent:FindFirstChildOfClass("Humanoid") then
144
			part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
145
		end
146
		part:Destroy()
147
		part = clone
148
	elseif key == "t" and plr.Character.Parent == workspace.Camera and part == nil then
149
		plr.Character.Parent = workspace
150
		plr.Character.Archivable = false
151
		plr.Character:FindFirstChildOfClass("ForceField"):Remove()
152
		for y,t in pairs(plr.Character:GetChildren()) do
153
			if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
154
				t.Transparency = 0
155
				if t.Name == "Head" and t:FindFirstChild("face") then
156
					t.face.Transparency = 0
157
				end
158
			elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
159
				t.Handle.Transparency = 0
160
			end
161
		end
162
	end
163
end)
164
mouse.Button1Down:connect(function()
165
	if plr.Character.Parent == workspace.Camera then
166
		if mouse ~= nil then
167
			if mouse.Target ~= nil then
168
				part = mouse.Target
169
				bp = Instance.new("BodyPosition",part)
170
				bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
171
				bp.Position = part.Position
172
				particles = Instance.new("ParticleEmitter",part)
173
				particles.Color = ColorSequence.new(Color3.new(0,0,0))
174
				particles.Size = NumberSequence.new(1)
175
				particles.Texture = "rbxassetid://292289455"
176
				particles.VelocitySpread = 360
177
				particles.Speed = NumberRange.new(0)
178
				particles.RotSpeed = NumberRange.new(0)
179
				particles.Rotation = NumberRange.new(0)
180
				particles.Rate = 250
181
				particles.Lifetime = NumberRange.new(.2,.4)
182
				particles.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(.12,.688,0),NumberSequenceKeypoint.new(.891,.887,0),NumberSequenceKeypoint.new(1,1,0)})
183
				dwn = true
184
			end
185
		end
186
		while dwn == true do 
187
			wait()	
188
			bp.Position = mouse.hit.p
189
			if part then
190
				if part.Parent:FindFirstChildOfClass("Humanoid") then
191
					part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
192
				end
193
			end
194
		end
195
	end
196
end)
197
mouse.Button1Up:connect(function()
198
	dwn = false
199
	if part then if part.Parent:FindFirstChildOfClass("Humanoid") then part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false end part = nil end
200
	if bp then bp:Destroy() end
201
	if particles then particles:Destroy() end
202
end)
203
base = Instance.new("ScreenGui",plr.PlayerGui)
204
bbg = Instance.new("BillboardGui",plr.Character.Head)
205
bbg.Size = UDim2.new(0,200,0,50)
206
bbg.StudsOffset = Vector3.new(0,3,0)
207
bbgTl = Instance.new("TextLabel",bbg)
208
bbgTl.BackgroundTransparency = 1
209
bbgTl.Size = UDim2.new(10,0,1,0)
210
bbgTl.Position = UDim2.new(-4.5,0,0,0)
211
bbgTl.Font = "Code"
212
bbgTl.Text = " "
213
bbgTl.TextSize = 25
214
bbgTl.TextStrokeColor3 = Color3.new(1,1,1)
215
bbgTl.TextColor3 = Color3.new(0,0,0)
216
bbgTl.TextStrokeTransparency = 0
217
bbgTl.TextWrapped = true
218
plr.Chatted:connect(function(msg)
219
	bbgTl.Text = msg
220
	wait(5)
221
	if bbgTl.Text == msg then
222
		bbgTl.Text = " "
223
	end
224
end)
225
touchCounter = 0
226
while wait() do
227
	if plr.Character.Parent == workspace.Camera then
228
		local c = plr.Character:Clone()
229
		c:MakeJoints()
230
		for y,t in pairs(c:GetChildren()) do
231
			if t:IsA("Part") then
232
				t.CanCollide = false 
233
				t.Anchored = true 
234
				t.Transparency = .5
235
				t.TopSurface = "Smooth"
236
				t.BottomSurface = "Smooth"
237
				t.RightSurface = "Smooth"
238
				t.LeftSurface = "Smooth"
239
				t.FrontSurface = "Smooth"
240
				t.BackSurface = "Smooth"
241
				t.BrickColor = BrickColor.new("Really black")
242
				if t.Name == "Head" and t:FindFirstChild("face") then
243
					t.face:Remove()
244
				elseif t.Name == "Torso" and t:FindFirstChild("roblox") then
245
					t.roblox:Remove()
246
				elseif t.Name == "HumanoidRootPart" then
247
					t:Remove()
248
				end
249
			else 
250
				t:Remove()
251
			end
252
		end
253
		c.Parent = workspace
254
		game.Debris:AddItem(c,.05)
255
	end
256
end