I want to make sure that a local player apnuly 10 forces he has a red fist energy and when he apnugates 100 forces he will have blue my script
local repStorage = game:GetService("ReplicatedStorage")
local TakeDamage = repStorage.FireTakeDamage
local function newPart(name, parent, nidPoint, start, ray, pos)
local part = Instance.new("Part", parent)
part.Anchored = true
part.CanCollide = false
part.Name = name
if pos then
part.CFrame = pos
part.Transparency = 1
else
part.CFrame = CFrame.new(nidPoint, start)
part.Size = Vector3.new(1,1, ray.Direction.Magnitude)
part.Transparency = 0.5
part.Material = Enum.Material.SmoothPlastic
part.Color = Color3.fromRGB(40,171,22)
end
return part
end
local function newBeam(parent, start, endPart, curve)
local att0 = Instance.new("Attachment", start)
local att1 = Instance.new("Attachment", endPart)
local beam = Instance.new("Beam", parent)
beam.Attachment0 = att0
beam.Attachment1 = att1
beam.CurveSize0 = curve
return beam
end
local function energyFist(player, ray)
local char = player.Character
local nidPoint = ray.Origin + ray.Direction / 2
local rayStart = ray.Origin
local part = newPart(player.Name.."'s Energy Fist", game.Workspace, nidPoint, rayStart, ray, nil)
Debris:AddItem(part, 1)
end
local function soulHarvest(player, ray, hit)
local char = player.Character
local rayEnd = ray.Origin + ray.Direction
local rayStart = ray.Origin
if hit then
local hitChar
if hit.Parent:IsA("Accessory") then
hitChar = hit.Parent.Parent
else
hitChar = hit.Parent
end
if hitChar and hitChar:FindFirstChild("Humanoid") then
local endPart = newPart("end", game.Workspace, rayEnd / 2, rayStart, ray, hitChar.Head.CFrame)
local startPart = newPart("start", game.Workspace, rayEnd / 2, rayStart, ray, char.Head.CFrame)
local beam1 = newBeam(game.Workspace, startPart, endPart, 3)
local beam2 = newBeam(game.Workspace, startPart, endPart, -3)
hitChar.Humanoid:TakeDamage(player.Psp.Value)
Debris:AddItem(endPart, 1)
Debris:AddItem(startPart, 1)
Debris:AddItem(beam1, 1)
Debris:AddItem(beam2, 1)
end
end
end
local timeBetweenTp = nil
local function tp(player, mousePos)
if timeBetweenTp then
if os.time() - timeBetweenTp <= 5 then
return
end
end
timeBetweenTp = os.time()
local Radius = player.Psp.Value / 10000
if Radius > 200 then
Radius = 200
end
local char = player.Character
local HRP = char:FindFirstChild("HumanoidRootPart")
if not HRP then return end
HRP.CFrame = CFrame.lookAt(HRP.Position, Vector3.new(mousePos))
if (mousePos - HRP.Position).Magnitude <= Radius then
HRP.Position = mousePos
else
HRP.Position += ((mousePos - HRP.Position).Unit) * Radius
end
end
repStorage.EnergyFist.OnServerEvent:Connect(energyFist)
repStorage.SoulHarvest.OnServerEvent:Connect(soulHarvest)
repStorage.TP.OnServerEvent:Connect(tp)```