I think I checked everything. From spelling to syntax, but nothing is working. I put a print to check if it is fired but it isn't.

Here's a picture of where they're parented to: http://imgur.com/Sx6FRRw

LocalScript

local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local mouse = player:GetMouse()
local debounce = false
local debounce2 = false
local debounce3 = false
    local INPUT_CONNECTION
local mousePos = mouse.Hit.Position
script.Parent.Equipped:Connect(function()
    INPUT_CONNECTION = UIS.InputBegan:Connect(function(Input, IsTyping)
        if not IsTyping then
            if not debounce then
                if Input.KeyCode == Enum.KeyCode.Z then
					debounce = true
                    game.ReplicatedStorage.FruitRemotes.Pistol:FireServer(mousePos)
					wait(2)
					debounce = false
                end   
            end
        end
    end)
end)

script.Parent.Unequipped:Connect(function()
    INPUT_CONNECTION:Disconnect()
end)

Pistol Server Script

game.ReplicatedStorage.FruitRemotes.Pistol.OnServerEvent:Connect(function(player, mousePos)
	print("pistol")
	local character = player.Character
	local arm = {character.RightHand, character.RightLowerArm, character.RightUpperArm}
	
	local animation = character.Humanoid:LoadAnimation(script.Parent.PistolAnim)
	animation:Play()
	
	local Tween = game:GetService("TweenService")
	local scalefactor = 2
	local offset
	local dialationCentre = (character.rightUpperArm.Position + character.rightLowerArm.Position + character.rightHandPosition)/3
	
	local info = TweenInfo.new(
	1,
	Enum.EasingStyle.Linear,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
	)
	
	for i,v in pairs(arm) do
		local pos = v.Position
		local offset = pos - dialationCentre
		offset = offset * scalefactor
		
		local Goals =
		{
		Position = dialationCentre + offset;
		Size = v.Size * scalefactor
		}
		local gomuTween = Tween:Create(v, info, Goals)
		gomuTween:Play()
	end
	
end)

2 comments

0

Print after all the lines and see where it stops and figure out what the problem is from there. So, after each line do print("1"), print("2"), etc.

0

ok