This is the Local Script
local RS = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local Plr = game.Players.LocalPlayer
repeat task.wait() until Plr.Character
local char = Plr.Character or Plr.CharacterAdded:Wait()
local Humanoid = char:WaitForChild("Humanoid")
local GomuGomuNoPistol = script:WaitForChild("Gomu Gomu No Pistol")
local GomuGomuNoPistolTrack = Humanoid:LoadAnimation(GomuGomuNoPistol)
local Event = RS:WaitForChild("Events"):WaitForChild("Gomu")
local Tool = script.Parent
local Equipped = false
local CD = false
Tool.Equipped:Connect(function()
Equipped = true
Tool.Unequipped:Wait()
Equipped = false
end)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
if Equipped == true then
if CD == false then
CD = true
GomuGomuNoPistolTrack:Play()
Humanoid.AutoRotate = false
Humanoid.WalkSpeed = 0
wait(0.5)
Event:FireServer()
wait(0.8)
Humanoid.WalkSpeed = 16
Humanoid.AutoRotate = true
wait(2)
CD = false
end
end
end
end)
and this is the Server Script After its Fired the Event
local RS = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local Event = RS:WaitForChild("Events"):WaitForChild("Gomu")
local Tool = script.Parent
Event.OnServerEvent:Connect(function()
local Character = Tool.Parent
local RightArm = Character:WaitForChild("Right Arm")
local Head = Character:WaitForChild("Head")
local RightArmPart = Instance.new("Part")
RightArm.Transparency = 1
RightArmPart.Material = Enum.Material.SmoothPlastic
RightArmPart.Name = ("RightArmPart")
RightArmPart.Massless = true
RightArmPart.CFrame = RightArm.CFrame
RightArmPart.Size = RightArm.Size
RightArmPart.CanCollide = false
RightArmPart.Anchored = false
RightArmPart.Orientation = RightArm.Orientation
RightArmPart.Color = RightArm.Color
RightArmPart.Parent = workspace
local weld = Instance.new("ManualWeld")
weld.Part0 = RightArmPart
weld.Part1 = RightArm
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local TweenService = game:GetService("TweenService")
local PistolInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, true, 0)
local ArmSpeed = Vector3.new(0,0,10)
local pos = RightArmPart.CFrame + RightArmPart.CFrame.LookVector*5
local Shockwave1 = RS.SW1:Clone()
Shockwave1.Position = RightArm.CFrame * Vector3.new(5,0,0)
Shockwave1.Orientation = pos.Position
Shockwave1.Parent = workspace
local PistolTweenSize = TweenService:Create(RightArmPart, PistolInfo, {Size = Vector3.new(1,50,1)})
local TweenPos = TweenService:Create(weld, PistolInfo, {C0 = CFrame.new(0, 24, 0)}):Play()
PistolTweenSize:Play()
wait(0.6)
RightArmPart:Destroy()
RightArm.Transparency = 0
end)
What happens is when they have there Tool Equipped if someone Activates the Event it will happen to them aswell
If you understand what im saying can someone help to prevent this?
this is what happens when i Click E while they have the Tool equipped