/
ClientReceive
98 lines (83 loc) · 3.07 KB
/
ClientReceive
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
local lighting = game:GetService("Lighting")
local Players = game:GetService("Players")
local TCS = game:GetService("TextChatService")
local RS = game:GetService("ReplicatedStorage"):WaitForChild("SRAdminEvents")
local CLTEvent = RS:WaitForChild("CLTEvent")
local pltevent = RS:WaitForChild("PltEvent")
local GetTagInfo = RS:WaitForChild("GetChatTags")
local trackEvent = RS:WaitForChild("TrackEvent")
local camera = game.Workspace.CurrentCamera
local muted = false
local player = game.Players.LocalPlayer
-- Main event that deals with client related stuff
CLTEvent.OnClientEvent:Connect(function(action,optextraval)
if action == "Set Time" then
if optextraval then
lighting.ClockTime = optextraval
end
elseif action == "View" then
if optextraval then
local targplr = optextraval
local char = targplr.Character or targplr.CharacterAdded:Wait()
camera.CameraSubject = char
end
end
end)
-- basically enables platform stand on the humanoid or not. kinda useless tbh other than the flight stuff
pltevent.OnClientEvent:Connect(function(cmd)
if cmd then
local targplr = game.Players.LocalPlayer
local char = targplr.Character or targplr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
if hum and cmd == "Stand" then
hum.PlatformStand = false
elseif hum and cmd == "PlatSt" then
hum.PlatformStand = true
end
end
end)
-- new chat service chat tag
TCS.OnIncomingMessage = function(message: TextChatMessage)
if message.TextSource and TCS.ChatVersion == Enum.ChatVersion.TextChatService and muted == false then
local plr = Players:GetPlayerByUserId(message.TextSource.UserId)
if plr then
local taginfo = GetTagInfo:InvokeServer(plr)
if taginfo and taginfo[3] == true then
local color3 = taginfo[2]
local htmlcolor =string.format("#%02X%02X%02X", color3.R * 0xFF, color3.G * 0xFF, color3.B * 0xFF)
local properties = Instance.new("TextChatMessageProperties")
properties.PrefixText = "<font color='"..htmlcolor.."'>["..taginfo[1].."]</font>"..message.PrefixText
return properties
end
end
end
end
-- for tracking cmd
trackEvent.OnClientEvent:Connect(function(action,hrp)
if hrp then
local char = player.Character or player.CharacterAdded:Wait()
local humrootpart = char:WaitForChild("HumanoidRootPart")
if action == "track" then
local a1,a2 = nil,nil
if humrootpart:FindFirstChild("Original") then
a1 = humrootpart:FindFirstChild("Original")
end
if hrp:FindFirstChild("Original") then
a2 = hrp:FindFirstChild("Original")
end
if a1 and a2 then
local trackBeam = Instance.new("Beam")
trackBeam.Color = ColorSequence.new(Color3.new(0.333333, 1, 1))
trackBeam.Attachment0 = a1
trackBeam.Attachment1 = a2
trackBeam.Parent = humrootpart
trackBeam.Enabled = true
trackBeam.Name = game.Players:GetPlayerFromCharacter(hrp.Parent).Name
end
elseif action == "untrack" then
if humrootpart:FindFirstChild(game.Players:GetPlayerFromCharacter(hrp.Parent).Name) then
humrootpart:FindFirstChild(game.Players:GetPlayerFromCharacter(hrp.Parent).Name):Destroy()
end
end
end
end)