I'm trying to create a hopperbin that has multiple uses. I've gotten this tool to work when I press play while in the Studio, but if I run a server and use the tool in there, one part of it will break. This part involves taking part from inside the hopperbin itself, cloning it and placing it in the workspace.
I'm a bit new to coding, so I'm having a hard time figuring out what the problem is here. If anyone could help me with this, I would be very grateful.
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Zanegsu-Slash-item?id=249793844"
local Tool = script.Parent
local Bullet = Tool:FindFirstChild("Part")
--Player
local plr = game.Players.LocalPlayer
--UserInputService
local uis = game:GetService('UserInputService')
local shooting = true
--Input Function
function Input(i)
--Check key
if i.KeyCode == Enum.KeyCode.F then
if shooting == true then
shooting = false
animTrack = plr.Character.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid
animTrack:Play()
--Clone Rocket
local Rocket = Bullet:Clone()
--Parent clone
Rocket.Parent = workspace
--Position clone
Rocket.Position = plr.Character.IchigoTorso.Shot.Position
--Rotation clone
Rocket.Rotation = plr.Character.Torso.Rotation
wait(5)
shooting = true
end
end
if i.KeyCode == Enum.KeyCode.E then
animTrack = plr.Character.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid
animTrack:Play()
end
end
function onSelected()
--Connect function
uis.InputBegan:connect(Input)
end
script.Parent.Selected:connect(onSelected)
The line:
Rocket.Position = plr.Character.IchigoTorso.Shot.Position
Is referring to a model that I have attached to the player, which doesn't seem to be the problem with this script.

2 comments
The animation isn't an issue at all
oh