All of the contents of the local script works, it takes the energy and plays the animation, but the 2nd script, which is a normal script, doesn't do anything. I do not get any errors either. The local script is inside of StarterPack, and the 2nd script is in the local script.

LocalScript, inside of starterPack:

local Player = game.Players.LocalPlayer 
local mouse = Player:GetMouse() 
local lastUse = 0;
local char = Player.Character or Player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
Player.CharacterAdded:connect(function(character)
        char = character
    hum = char:WaitForChild("Humanoid")
end)
if not hum.Parent then
    repeat wait(0.2) until hum.Parent
end

local function onKeyDown(key) 
    local Key = key:lower()
    if key == "z" and tick()-lastUse > 10 and Player.NonSave.SkillUse.Value == 0 and Player.Levelss.Hamon.Value == 1 and Player.Levelss.Energy.Value >=20  then 
	    lastUse = tick();
	game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("EruptionEvent"):FireServer() 
	    Player.NonSave.SkillUse.Value = 1
	    Player.Levelss.Energy.Value = Player.Levelss.Energy.Value - 20
      
			





         local animTrack = hum:LoadAnimation(script.Eruption)
			animTrack:Play()
			wait(1)
			animTrack:Stop()
            


        wait(2)
        Player.NonSave.SkillUse.Value = 0

      


        
    end
end


mouse.KeyDown:connect(onKeyDown)

2nd script, normal script, inside of the local script:

local PartEvent = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("EruptionEvent")
local Player = script.Parent.Parent.Parent
local char = Player.Character


local function CreatePart(player)
	  local x = Instance.new("Part")
        x.BrickColor = BrickColor.new("Gold")
        x.Material = "Neon"
        x.CanCollide = false
        x.Transparency = 0.9
        x.Size = Vector3.new(12,1,12)
        x.TopSurface = "Smooth"
        x.BottomSurface = "Smooth"
        x.Shape = "Block"
        x.Anchored = true
        x.Name = Player.Name
        local fix =  game.ReplicatedStorage.EmergencySkillRemove:Clone()
	    fix.Parent = x
        local m = Instance.new("CylinderMesh")
        m.Scale = Vector3.new(0.8,0.8,0.8)
		m.Parent = x
        local fd = script.fireDamage:clone()
        fd.Parent = x
        local DAMAGE = script.Damage:clone()
        DAMAGE.Value = DAMAGE.Value + Player.Levelss.SkillDamage.Value
        DAMAGE.Parent = fd
       
        local ef = script.ef:Clone()
			ef.Parent = char["RightFoot"]
			local ef3 = script.ef:Clone()
			ef3.Parent = char["RightUpperLeg"]
			local ef4 = script.ef:Clone()
			ef4.Parent = char["RightLowerLeg"]
			
			
			      local a = Instance.new("Sound")
        a.SoundId = "http://www.roblox.com/asset/?id=82277505" --76047008
        a.Parent = x
        a.Volume = 1
        a:play()

      x.CFrame = Player.Character.UpperTorso.CFrame*CFrame.new(0, -2.9 , 0)  * CFrame.fromEulerAnglesXYZ(-2.7,0,0)
        x.Parent = workspace  
        game.Debris:AddItem(x, 5)
        game.Debris:AddItem(ef,5)
        game.Debris:AddItem(ef3,5)
        game.Debris:AddItem(ef4,5)
      
  
        for explode = 1,30 do
		m.Scale = m.Scale + Vector3.new(0.01,0,0.01)
		x.Transparency = x.Transparency - 0.02
		wait(0.0001)
        end
         
        local mist = script.Effect:clone()
        mist.Parent = x

end


PartEvent.OnServerEvent:Connect(CreatePart)

Thank you in advance. Sorry if I was bad at explaining, I can edit if anyone has any questions.

2 comments

0

Why do you have a script inside of a localscript? The script should be in serverscriptservice.

0

To tag the player. I got it solved tho