Why does my script not work when its cloned from Replicated storage?
Basically what happens is I try to clone a tool from ReplicatedStorage using this script
01 | local ServerStorage = game:GetService( "ReplicatedStorage" ) |
02 | local tool = ServerStorage:FindFirstChild( "Cigaratte" ) |
03 | local player = game:GetService( "Players" ).LocalPlayer |
06 | script.Parent.Activated:Connect( function () |
09 | tool:Clone().Parent = player.Backpack |
Once I have cloned this tool it shows up in my inventory and I can select it and hold it, however any animations/Interactions and my activated function doesn't work, basically everything in this script
01 | local player = game:GetService( "Players" ).LocalPlayer |
02 | local Character = player.CharacterAdded:wait() or player.Character |
03 | local Humanoid 1 = Character:WaitForChild( "Humanoid" ) |
04 | local smk = script.Smoking |
05 | local LoadAnimation 1 = Humanoid 1 :LoadAnimation(smk) |
06 | local IsSmoking = false |
07 | local Cigaratte = script.Parent.Part |
08 | local TweenService = game:GetService( "TweenService" ) |
10 | local tweenInfo = TweenInfo.new( |
12 | Enum.EasingStyle.Linear, |
13 | Enum.EasingDirection.Out, |
19 | local tween = TweenService:Create(Cigaratte, tweenInfo, { Size = Vector 3. new( 0.45 , 0.086 , 0.086 ) } ) |
21 | script.Parent.Activated:Connect( function () |
28 | script.Parent.Deactivated:Connect( function () |
Both scripts are local scripts, I also have an Animation whose parent is the script above.