-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove ClientCaster:GetPing - Remove ClientCaster:GetMaxPingExhaustion - Remove ClientCaster:SetMaxPingExhaustion - Update raycast data serialization to take up less space
- Loading branch information
Showing
7 changed files
with
114 additions
and
173 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
local Players = game:GetService("Players") | ||
local ReplicatedStorage = game:GetService("ReplicatedStorage") | ||
|
||
local LocalPlayer = Players.LocalPlayer | ||
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") | ||
|
||
local ToggleUI = Instance.new("ScreenGui") | ||
|
||
local ToggleButton = Instance.new("TextButton") | ||
ToggleButton.Size = UDim2.new(0, 100, 0, 50) | ||
ToggleButton.Position = UDim2.new(0, 0, 0, 0) | ||
ToggleButton.Text = "Toggle" | ||
ToggleButton.TextColor3 = Color3.new(1, 0, 0) | ||
ToggleButton.TextScaled = true | ||
ToggleButton.Parent = ToggleUI | ||
|
||
ToggleUI.Parent = PlayerGui | ||
|
||
local Remote = ReplicatedStorage:WaitForChild("RemoteEvent") | ||
local Enabled = false | ||
ToggleButton.MouseButton1Click:Connect(function() | ||
Enabled = not Enabled | ||
ToggleButton.TextColor3 = Enabled and Color3.new(0, 1, 0) or Color3.new(1, 0, 0) | ||
Remote:FireServer() | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
local Players = game:GetService("Players") | ||
local ReplicatedStorage = game:GetService("ReplicatedStorage") | ||
|
||
local ClientCast = require(ReplicatedStorage.ClientCast) | ||
|
||
local RemoteEvent = Instance.new("RemoteEvent") | ||
RemoteEvent.Parent = ReplicatedStorage | ||
|
||
local TestPart = Instance.new("Part") | ||
TestPart.Anchored = true | ||
TestPart.CanCollide = false | ||
TestPart.CFrame = CFrame.new(0, 2, 0) | ||
TestPart.Parent = workspace | ||
|
||
for X = -2, 2 do | ||
local Attachment = Instance.new("Attachment") | ||
Attachment.Name = "DmgPoint" | ||
Attachment.Position = Vector3.new(X, 0, 0) | ||
Attachment.Parent = TestPart | ||
end | ||
|
||
local Table = {} -- Player = Caster | ||
|
||
local function StartCasting(Player) | ||
local CurrentCaster = Table[Player] | ||
if CurrentCaster.Disabled then | ||
CurrentCaster:Start() | ||
else | ||
CurrentCaster:Stop() | ||
end | ||
end | ||
|
||
Players.PlayerAdded:Connect(function(Player) | ||
Player.CharacterAdded:Connect(function(Character) | ||
local Humanoid = Character:WaitForChild("Humanoid", 1) | ||
|
||
local ClientCaster = ClientCast.new(TestPart, RaycastParams.new()) | ||
ClientCaster:SetOwner(Player) | ||
ClientCaster._Debug = true | ||
|
||
ClientCaster.HumanoidCollided:Connect(function(_, HitHumanoid) | ||
print("Hit model:" .. HitHumanoid.Parent.Name) | ||
end) | ||
|
||
Table[Player] = ClientCaster | ||
|
||
Humanoid.Died:Connect(function() | ||
ClientCaster:Destroy() | ||
Table[Player] = nil | ||
end) | ||
end) | ||
end) | ||
|
||
RemoteEvent.OnServerEvent:Connect(StartCasting) |