Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create a script and copy that
- Punch script
- -----------------------------------------------------------------------
- --Made by shebov3
- math.randomseed(tick())
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local punchEvent = Instance.new("RemoteEvent", ReplicatedStorage)
- punchEvent.Name = "PunchEvent"
- local animations = {} put your animation id
- local function onPunchFired(plr)
- local char = game.Workspace:FindFirstChild(plr.Name)
- local humanoid = char.Humanoid
- local animation = Instance.new("Animation")
- local picked = math.random(1, #animations)
- animation.AnimationId = "http://roblox.com/asset/?id="..animations[picked]
- local animTrack = humanoid:LoadAnimation(animation)
- animTrack:Play()
- local dmgScript = script.DmgScript:Clone()
- if picked == 1 then
- dmgScript.Parent = char.RightHand
- elseif picked == 2 then
- dmgScript.Parent = char.LeftHand
- end
- dmgScript.Disabled = false
- wait(0.4)
- dmgScript:Destroy()
- end
- punchEvent.OnServerEvent:Connect(onPunchFired)
- create a script and put it in ServerScriptService
- ----------------------------------------------------------------------------
- create another script
- then copy that
- -------------------------------------------------------------------------
- Dmg script
- script.Parent.Touched:Connect(function(hit)
- local char = hit.Parent
- local hum = char:FindFirstChild("Humanoid")
- if hum and char.Name ~= script.Parent.Parent.Name then
- hum.Health = hum.Health - script.Dmg.Value
- script.Disabled = true
- wait(0.5)
- script.Disabled = false
- end
- end)
- ------------------------------------------------------------------
- then put it on the first script
- put on it a stringe value
- after that all open startercharacterscripts
- and do a local script
- and copy that script
- -----------------------------------------
- --Made by shebov3
- wait (0.1)
- local UserInputService = game:GetService("UserInputService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local punchEvent = ReplicatedStorage:WaitForChild("PunchEvent")
- local ready = true
- local function punch(inputObject, gameProcessed)
- if inputObject.KeyCode == Enum.KeyCode.E and ready then
- punchEvent:FireServer()
- ready = false
- wait(0.4)
- ready = true
- end
- end
- UserInputService.InputBegan:Connect(punch)
- ----------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement