Skip to content

Commit

Permalink
v1.12.0
Browse files Browse the repository at this point in the history
- Updated Testing.server.lua to set player Owner
- Updated testing.project.json to work properly
- Removed debug warning which was left out
  • Loading branch information
Pyseph committed Jul 4, 2022
1 parent 954d39c commit b35bd90
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/release.rbxm
/roblox.yml
/moonwave.toml
build/
build/
/sourcemap.json
2 changes: 0 additions & 2 deletions lib/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,6 @@ function ClientCaster:Start()
local ReplicationConn = self._ReplicationConnection
if ReplicationConn then
ReplicationConn:Start()
else
warn("No replication connection found")
end

ClientCast.InitiatedCasters[self] = {}
Expand Down
5 changes: 2 additions & 3 deletions testing.project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "[ClientCast] testing",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"ClientCast": {
Expand All @@ -9,9 +10,7 @@
},
"ServerScriptService": {
"$className": "ServerScriptService",
"Server": {
"$path": "testing"
}
"$path": "testing"
}
}
}
37 changes: 35 additions & 2 deletions testing/Testing.server.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local ClientCast = require(ReplicatedStorage.hello_world)
local TestingPlayer = Players:GetPlayers()[1] or Players.PlayerAdded:Wait()

print(ClientCast)
local ClientCast = require(ReplicatedStorage.ClientCast)

local KillPart = Instance.new("Part")
KillPart.Anchored = true
KillPart.CanCollide = false
KillPart.CFrame = CFrame.new(0, 1, 0)
KillPart.Parent = workspace

local function GenerateAttachment(Position)
local Attachment = Instance.new("Attachment")
Attachment.Name = "DmgPoint"
Attachment.Position = Position
Attachment.Parent = KillPart
end

for X = -2, 2 do
GenerateAttachment(Vector3.new(X, 0, 0))
end

local ClientCaster = ClientCast.new(KillPart, RaycastParams.new(), TestingPlayer)
local Debounce = {}
ClientCaster.HumanoidCollided:Connect(function(_, HitHumanoid)
if Debounce[HitHumanoid] then
return
end
Debounce[HitHumanoid] = true
print("Ow!")
HitHumanoid:TakeDamage(10)

wait(0.5)
Debounce[HitHumanoid] = false
end)
ClientCaster:Start()

0 comments on commit b35bd90

Please sign in to comment.