Problem with remove event tool

  1. What do you want to achieve? I want to make so when the tool is activated it creates a part near the character

  2. What is the issue? The animation is playing but it is not printing and not creating a part

  3. What solutions have you tried so far? I tried many editions of the script but it didn’t help

Local script


local tool = script.Parent
local Handle = script.Parent.Handle
local remote = game.StarterPack.Ember.RemoteEvent

tool.Activated:Connect(function()
	local tool = script.Parent
	local anim = Instance.new("Animation")
	anim.AnimationId = "http://www.roblox.com/Asset?ID=6307341520"
	local track
		track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
		track.Priority = Enum.AnimationPriority.Action
		track:Play()
		wait(1)
		track:Stop()
	tool:Destroy()
	
	remote:FireServer(tool)

end)

script

local tool = script.Parent
local handle = script.Parent.Handle

script.Parent.RemoteEvent.OnServerEvent:Connect(function(player, tool)
	
	local char = player.Character
	
	pairs("Works")
	
	local HRP = char.HumanoidRootPart
	
	local part = Instance.new("Part",game.Workspace)
	part.Anchored = true
	part.CanCollide = false
	part.Shape = Enum.PartType.Ball
	part.Color = Color3.fromRGB(97, 134, 255)
	part.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0,10,0)
	
	
end)

I don’t have any errors in the output

Screenshot_72

robloxapp-20210131-1736596.wmv (872.6 KB)

I don’t know how but I wrote “pairs” and not “print” :rofl:

1 Like

Just something to ask; why are you handling the animation off of a RemoteEvent? You can instead do

local char = tool.Parent
1 Like

Roblox recently deprecated Humanoid:LoadAnimation(). You are either gonna want to create a variable for the Animator in the humanoid, or do humanoid.Animator:LoadAnimation().

1 Like

I will be using it too. Thanks for the information :smiley:

1 Like