So Im making a mine script and here's my LOCAL SCRIPT
local plr = game.Players.LocalPlayer
local char = plr.Character
local Mouse = plr:GetMouse()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remotes = ReplicatedStorage:WaitForChild("RemoteEvent")
Mouse.Button1Down:Connect(function()
local Part = Instance.new("Part")
Part.Parent = workspace
Part.Anchored = true
Part.Position = Mouse.Hit.p
Part.Touched:Connect(function(touch)
EHum = touch.Parent:FindFirstChild('Humanoid')
if EHum and not plr.Character.Humanoid then
Remotes:FireServer(Part.Position,Part)
end
end)
end)
And then here's my
SEVERSCRIPT
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild('RemoteEvent')
local Debounce = false
RemoteEvent.OnServerEvent:Connect(function(player,partposition)
Explosion = Instance.new("Explosion")
Explosion.Parent = workspace
Explosion.Position = partposition
Explosion.DestroyJointRadiusPercent = 0
Explosion.Hit:Connect(function(hit,distance)
EnemyHumanoid = hit.Parent:FindFirstChild('Humanoid')
if EnemyHumanoid and not player.Character.Humanoid then
if Debounce == true then return end
if Debounce == false then
EnemyHumanoid:TakeDamage(20)
print('gay')
Debounce = true
end
end
end)
end)

1 comment
Can you be more clear with your question? What are you trying to accomplish. Give a DETAILED explanation. Also, why the heck are you printing "gay"