View difference between Paste ID: 0TSxT3WJ and mHen7C7i
SHOW: | | - or go back to the newest paste.
1
--Pelikone Gifted by TheRedAngel, Regular Script!
2
3
me = game.Players.LocalPlayer.Character.Torso
4
name = "xSoul's Machine"
5
mainpos = Vector3.new(me.Position.X + 10,0.3,me.Position.Z)
6
maxdist = 7
7
imgs = {"http://www.roblox.com/asset/?id=43267871","http://www.roblox.com/asset/?id=43267737",
8
"http://www.roblox.com/asset/?id=43267826","http://www.roblox.com/asset/?id=43267704",
9
"http://www.roblox.com/asset/?id=43267858"}
10
11
a = imgs[1]
12
b = imgs[2]
13
c = imgs[3]
14
d = imgs[4]
15
e = imgs[5]
16
17
give = true
18
function givestats(player)
19
	local stat = Instance.new("IntValue")
20
	stat.Name = "leaderstats"
21
	local tix = Instance.new("IntValue")
22
	tix.Name = "Tix"
23
	tix.Value = 25
24
	tix.Parent = stat
25
	stat.Parent = player
26
end
27
for _,v in pairs(game.Players:GetPlayers()) do
28
	if v:findFirstChild("leaderstats") == nil then
29
		givestats(v)
30
	end
31
end
32
game.Players.PlayerAdded:connect(function(plyr) if give then givestats(plyr) end end)
33
34
function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
35
part.Parent = parent
36
part.formFactor = form
37
part.CanCollide = collide
38
part.Transparency = tran
39
part.Reflectance = ref
40
part.Size = Vector3.new(x,y,z)
41
part.BrickColor = BrickColor.new(color)
42
part.TopSurface = 0
43
part.BottomSurface = 0
44
part.Anchored = anchor
45
part.Locked = true
46
part:BreakJoints()
47
end
48
49
function weld(w, p, p1, a, b, c, x, y, z)
50
w.Parent = p
51
w.Part0 = p
52
w.Part1 = p1
53
w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
54
end
55
56
dings = {}
57
58
function getplyr(pos)
59
	local dist = maxdist
60
	local plyr = nil
61
	for _,v in pairs(game.Players:GetPlayers()) do
62
		if v.Character ~= nil then
63
			local to = v.Character:findFirstChild("Torso")
64
			if to ~= nil then
65
				if (to.Position - pos).magnitude < dist then
66
					dist = (to.Position - pos).magnitude
67
					plyr = v
68
				end
69
			end
70
		end
71
	end
72
	return plyr
73
end
74
75
function reward(first,second,third,mod,pos,play)
76
	local k = 0
77
	if first.Texture == a and second.Texture == a and third.Texture == a then
78
		k = 3
79
	elseif first.Texture == b and second.Texture == b and third.Texture == b then
80
		k = 5
81
	elseif first.Texture == c and second.Texture == c and third.Texture == c then
82
		k = 8
83
	elseif first.Texture == d and second.Texture == d and third.Texture == d then
84
		k = 25
85
	elseif first.Texture == e and second.Texture == e and third.Texture == e then
86
		k = 75
87
	elseif first.Texture == d and second.Texture == d or third.Texture == d and second.Texture == d or third.Texture == d and first.Texture == d then
88
		k = 14
89
	elseif first.Texture == e and second.Texture == e or third.Texture == e and second.Texture == e or third.Texture == e and first.Texture == e then
90
		k = 35
91
	end
92
	for i=1,k do
93
		wait()
94
		local t = Instance.new("Part")
95
		prop(t, mod, true, 0, 0, 0.6, 0.1, 0.3, "Bright yellow", false, "Custom")
96
		t.CFrame = CFrame.new(pos + Vector3.new(math.random(-100,100)/100,0,math.random(-50,50)/100)) * CFrame.Angles(0,math.random(-32,32)/10,0)
97
		local dec = Instance.new("Decal",t)
98
		dec.Face = "Top"
99
		dec.Texture = "http://www.roblox.com/asset/?id=42602113"
100
		local de2 = dec:clone()
101
		de2.Parent = t
102
		de2.Face = "Bottom"
103
		local de = true
104
		coroutine.resume(coroutine.create(function()
105
			wait(23)
106
			t:remove()
107
		end))
108
		t.Touched:connect(function(hit)
109
			if de then
110
				if hit.Parent.Name == play.Name then
111
					local sta = play:findFirstChild("leaderstats")
112
					if sta ~= nil then
113
						local tx = sta:findFirstChild("Tix")
114
						if tx ~= nil then
115
							de = false
116
							tx.Value = tx.Value + 1
117
							t:remove()
118
						end
119
					end
120
				end
121
			end
122
		end)
123
	end
124
end
125
126
local lol = workspace:findFirstChild(name)
127
if lol ~= nil then
128
	lol:remove()
129
end
130
131
machine = Instance.new("Model",workspace.Base)
132
machine.Name = name
133
134
mainpart = Instance.new("Part")
135
prop(mainpart,machine,true,0,0,5.7,9,5.1,"Bright red",true,"Custom")
136
mainpart.CFrame = CFrame.new(mainpos) * CFrame.new(0,mainpart.Size.Y/2,0)
137
138
dec1 = Instance.new("Part")
139
prop(dec1,machine,true,0,0,5,9.1,4.3,"Black",true,"Custom")
140
dec1.CFrame = mainpart.CFrame
141
142
dec2 = Instance.new("Part")
143
prop(dec2,machine,true,0,0,5,8.4,5.2,"Black",true,"Custom")
144
dec2.CFrame = mainpart.CFrame
145
146
dec3 = Instance.new("Part")
147
prop(dec3,machine,true,0,0,5.8,8.4,4.3,"Black",true,"Custom")
148
dec3.CFrame = mainpart.CFrame
149
150
vend1 = Instance.new("Part")
151
prop(vend1,machine,true,0,0,1.8,1.8,1.8,"Bright red",true,"Custom")
152
vend1.CFrame = mainpart.CFrame * CFrame.new(-3.2,0,1.2)
153
Instance.new("SpecialMesh",vend1).MeshType = "Sphere"
154
155
vend2 = Instance.new("Part")
156
prop(vend2,machine,true,0,0,0.7,3.5,0.7,"Black",true,"Custom")
157
vend2.CFrame = vend1.CFrame * CFrame.new(-0.3,2.3,0)
158
Instance.new("SpecialMesh",vend2)
159
160
vend3 = Instance.new("Part")
161
prop(vend3,machine,true,0,0,1.3,1.3,1.3,"Bright red",true,"Custom")
162
vend3.CFrame = vend2.CFrame * CFrame.new(0,1.8,0)
163
Instance.new("SpecialMesh",vend3).MeshType = "Sphere"
164
165
click = Instance.new("ClickDetector",vend1)
166
click.MaxActivationDistance = maxdist
167
click.Name = "ClickHere"
168
abletoclick = true
169
170
for i=-180,-70,15 do
171
	local part = Instance.new("Part")
172
	prop(part,machine,false,0,0,3,0.4,0.1,"Black",true,"Custom")
173
	part.CFrame = mainpart.CFrame * CFrame.new(1.1,-1,2.8) * CFrame.Angles(math.rad(i),0,0) * CFrame.new(0,0,-1)
174
	table.insert(dings,part)
175
	for o=-1.5,1.5,3 do
176
		local part2 = Instance.new("Part")
177
		prop(part2,machine,false,0,0,0.1,0.4,1.2,"Bright red",true,"Custom")
178
		part2.CFrame = part.CFrame * CFrame.new(o,0,part2.Size.Z/2)
179
	end
180
end
181
182
things = {}
183
for i= -1.5, 1.5, 1.5 do
184
	local thing1 = Instance.new("Part")
185
	prop(thing1,machine,true,0,0,1.5,1,1.5,"White",true,"Custom")
186
	thing1.CFrame = mainpart.CFrame * CFrame.new(i,2,2.3) * CFrame.Angles(0,0,-math.pi/2)
187
	Instance.new("CylinderMesh",thing1)
188
	local dec = Instance.new("Decal",thing1)
189
	dec.Face = "Back"
190
	dec.Texture = imgs[1]
191
	table.insert(things,thing1)
192
end
193
on = things[1]
194
sec = things[2]
195
thi = things[3]
196
197
click.MouseClick:connect(function()
198
	if abletoclick == true then
199
		local player = getplyr(vend1.Position)
200
		if player ~= nil then
201
			local sta = player:findFirstChild("leaderstats")
202
			if sta ~= nil then
203
				local tc = sta:findFirstChild("Tix")
204
				if tc ~= nil then
205
					tc.Value = tc.Value - 4
206
				end
207
			end
208
			if abletoclick == true then
209
			abletoclick = false
210
			local bp = Instance.new("BodyPosition",player.Character.Torso)
211
			local to = bp.Parent
212
			local larm = to:findFirstChild("Left Shoulder")
213
			bp.P = 15000
214
			bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
215
			bp.position = mainpart.CFrame * CFrame.new(-2,-1,4).p
216
			local bg = Instance.new("BodyGyro",player.Character.Torso)
217
			bg.P = 15000
218
			bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
219
			bg.cframe = CFrame.new(to.Position, vend1.Position - Vector3.new(0,0.8,0))
220
			wait(0.4)
221
			bg.cframe = CFrame.new(to.Position, vend1.Position - Vector3.new(0,0.8,0))
222
			local orig = nil
223
			if larm ~= nil then
224
				orig = larm.C0
225
				for i=0, 3, 0.4 do
226
					larm.C0 = orig * CFrame.fromEulerAnglesXYZ(0,0,-i)
227
					wait()
228
				end
229
				wait(0.1)
230
			else
231
				wait(0.2)
232
			end
233
			for i=0, 1.3, 0.15 do
234
				wait()
235
				vend2.CFrame = vend1.CFrame * CFrame.Angles(i,0,0) * CFrame.new(-0.3,2.3,0)
236
				vend3.CFrame = vend2.CFrame * CFrame.new(0,1.8,0)
237
				if larm ~= nil then
238
					larm.C0 = larm.C0 * CFrame.fromEulerAnglesXYZ(0,0,0.3)
239
				end
240
			end
241
			if larm ~= nil then
242
				larm.C0 = orig
243
			end
244
			wait(0.2)
245
			for i=1.3, 0, -0.3 do
246
				wait()
247
				vend2.CFrame = vend1.CFrame * CFrame.Angles(i,0,0) * CFrame.new(-0.3,2.3,0)
248
				vend3.CFrame = vend2.CFrame * CFrame.new(0,1.8,0)
249
			end
250
			bp.position = mainpart.CFrame * CFrame.new(0,-1,5.5).p
251
			bg.cframe = CFrame.new(to.Position, mainpart.Position)
252
			coroutine.resume(coroutine.create(function()
253
				wait(0.6)
254
				bg.cframe = CFrame.new(to.Position, mainpart.Position)
255
			end))
256
			for o=1,math.random(60,160) do
257
				local he = math.random(1,5)
258
				local he1 = math.random(1,5)
259
				local he2 = math.random(1,5)
260
				on.Decal.Texture = imgs[he]
261
				sec.Decal.Texture = imgs[he1]
262
				thi.Decal.Texture = imgs[he2]
263
				wait()
264
			end
265
			reward(on.Decal,sec.Decal,thi.Decal,machine,mainpart.CFrame * CFrame.new(1.1,-0.9,3).p,player)
266
			bp:remove()
267
			bg:remove()
268
			wait(1)
269
			abletoclick = true
270
			end
271
		end
272
	end
273
end)
274
275
game.Players.xSoulStealerx.Chatted:connect(function(msg)
276
	if msg == "leader" then
277
		give = false
278
		for _,v in pairs(game.Players:GetPlayers()) do
279
			if v:findFirstChild("leaderstats") ~= nil then
280
				v.leaderstats:remove()
281
			end
282
		end
283
	end
284
end)