-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointlight in button.txt
More file actions
102 lines (52 loc) · 1.82 KB
/
Copy pathpointlight in button.txt
File metadata and controls
102 lines (52 loc) · 1.82 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
local button = script.parent
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character
button.MouseButton1Click:Connect(function()
print("button di klik")
if character then
print("karakter ditemukan")
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
print("humanoid ditemukan")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://123677415157845"
local playanimation = humanoid:LoadAnimation(animation)
local speedtime = 0.5
local delaytime = 3
playanimation:Play()
playanimation:AdjustSpeed(speedtime)
playanimation.Priority = Enum.AnimationPriority.Action
-- add point light to button
local parthumanoid = character:FindFirstChild("UpperTorso") or character:FindFirstChild("Torso")
local ball = Instance.new("Part")
ball.Material = Enum.Material.Neon
ball.Shape = Enum.PartType.Ball
ball.Color = Color3.fromRGB(255, 0, 0)
ball.Size = Vector3.new(1,1,1)
ball.Anchored = false
ball.CanCollide = false
ball.Transparency = 1
ball.Parent = workspace
local light = Instance.new("PointLight")
light.Parent = ball
light.Range = 15
light.Color = Color3.fromRGB(255, 0, 0)
light.Brightness = 25
local weld = Instance.new("Weld")
weld.Part0 = parthumanoid
weld.Part1 = ball
weld.C0 = CFrame.new(0,2,0)
weld.Parent = ball
wait(2)
ball:Destroy()
-- end point light
wait(delaytime)
playanimation:Stop()
else
print("Humanoid tidak ditemukan")
end
else
print("karakter tidak ditemukan")
end
end)