When doing FE there are certain things that the Server can see and things that the Client can see. In my case the Server won't take this ani. I've tried passing down an argument to tell the Server which Ani it needs to pick, but it won't work. This it my script. Thanks for helping! :)

Local Script

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local UIS = game:GetService("UserInputService")
local Ani = game.ReplicatedStorage.Animation

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.E then
		game.ReplicatedStorage.RemoteEvent:FireServer(Mouse.hit,Ani)
	end
end)

Server Script

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player,Mousehit,Ani)--There is a Ani in the parameters Don't know why it won't show
	local Ani2 = Player.Character.Humanoid:LoadAnimation(Ani)
	Ani2:Play()
	local Part = workspace.h:Clone()
	Part.Anchored = false
	Part.CanCollide = false
	Part.Parent = workspace
	Part.CFrame = Player.Character.HumanoidRootPart.CFrame * CFrame.new(0,2,-5)
local bv = Instance.new("BodyVelocity")
   bv.Parent = Part
    bv.MaxForce = Vector3.new(1e8,1e8,1e8)
bv.Velocity = Mousehit.LookVector*50
end)

3 comments

0

It is Mouse.Hit not Mouse.hit

0

can't you play the animation on the client and then fire the event to do any other stuff?

0

Then No one will see that you've played the ani