Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED]Skill Damages in TestMode, but not in the normal game?

Asked by
soutpansa 120
7 years ago
Edited 7 years ago

I've already asked this question but got no answer, and before you mark this as already being asked, I am going to include extra information in the form of gyazo links and better explanation.

So, I'm currently working on a "skill" that plays and animation and places a yellow ball at the end of a players arm to damage other players. This is what it looks like in test mode. And This is what it looks like in a normal game.

See the difference? In the normal game it does not hurt the target.

Here is the main script, in the starter pack, that places and expands the ball:

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 then



        lastUse = tick();  
        local x = Instance.new("Part")
        x.BrickColor = BrickColor.new("Bright yellow")
        x.Material = "Neon"
        x.CanCollide = false
        x.Transparency = 0.4
        x.Size = Vector3.new(10,10,10)
        x.TopSurface = "Smooth"
        x.BottomSurface = "Smooth"
        x.Shape = "Ball"
        x.Name = Player.Name
        x.Anchored = true
        local fd = script.fireDamage:clone()
        fd.Parent = x
        local Mesh = Instance.new("SpecialMesh")
        Mesh.MeshType = "Sphere"
        Mesh.Scale = Vector3.new(1,1,1)
        Mesh.Parent = x
      --[[  local a = Instance.new("Sound")
        a.SoundId = "http://www.roblox.com/asset/?id=260430117"
        a.Parent = x
        a.Volume = 2
        a:play()]]

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













        x.CFrame = Player.Character.Torso.CFrame*CFrame.new(2, 1 , -4)
        x.Parent = workspace 

        for explode = 1,30 do
        Mesh.Scale = Mesh.Scale + Vector3.new(0.09,0.09,0.09)
        x.Transparency = x.Transparency + 0.03
        wait(0.001)
        end

        game.Debris:AddItem(x, 0.03)


    end
end





mouse.KeyDown:connect(onKeyDown)

And here is the script that handles the damage and making the target sit down (it is inside of the main script):

function onDamage(Part)
    if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~= script.Parent.Name and Part.Parent:FindFirstChild("ForceField") == nil  then



            Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health - script.Damage.Value
            Part.Parent.Humanoid.Sit = true

        end
        end




script.Parent.Touched:connect(onDamage)

P.S: To be clear, I am also not getting any errors from the output or developer console, and the game is NOT filtering enabled

Edit: I am getting an error, https://gyazo.com/8b7fed183bd03f0e79176d2a6d2023b7. It is strange, because there is no where near 1000 lines in the fireDamage script.

Answer this question