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

Spawning script not working? [More Errors]

Asked by 10 years ago

EDIT ONE: New script, new error When the death function is there the deathball go's on to my head, when delete it, it spawns in my torso. I want it to spawn in my torso.

player = game.Players.LocalPlayer
player:GetMouse().KeyDown:connect(function(key)
    if string.lower(key) ==  "q" then
        deathball = Instance.new("Part", Workspace)
        mesh = Instance.new("SpecialMesh")
        mesh.Parent = deathball
        deathball.Anchored = true
        mesh.MeshType = "Sphere"
        deathball.CanCollide=false
        deathball.TopSurface = "Smooth"
        deathball.Transparency=0.5
        player.Character.Torso.Anchored = true
        deathball.BrickColor = BrickColor.new("Deep orange")
        player.Character.Humanoid.MaxHealth = math.huge
        player.Character.Humanoid.Health = 9e9
        deathball.CFrame = player.Character.Torso.CFrame
        deathball.Touched:connect(function()
        player.Character.Humanoid.Health = player.Character.Humanoid.Health - 100 -- this function is giving my trouble. When i delete it, the script works, when it's there, it doesn't. Help?
        end)
        deathball.Size = Vector3.new(1.2, 1.2, 1.2)
        wait(0.1)
        deathball.Size = Vector3.new(2.2, 2.2, 2.2)
        wait(0.1)
        deathball.Size = Vector3.new(3.2, 3.2, 3.2)
        wait(0.1)
        deathball.Size = Vector3.new(4.2, 4.2, 4.2) 
        wait(0.1)
        deathball.Size = Vector3.new(4.2, 4.2, 4.2) 
        wait(0.1)
        deathball.Size = Vector3.new(5.2, 5.2, 5.2)
        wait(0.1)
        deathball.Size = Vector3.new(6.2, 6.2, 6.2)
        wait(0.1)
        deathball.Size = Vector3.new(7.2, 7.2, 7.2)
        wait(0.1)
        deathball.Size = Vector3.new(8.2, 8.2, 8.2)
        wait(0.1)
        deathball.Size = Vector3.new(9.2, 9.2, 9.2)
        wait(0.1)
        deathball.Size = Vector3.new(10.2, 10.2, 10.2)
        wait(0.1)
        deathball.Size = Vector3.new(11.2, 11.2, 11.2)
        wait(0.1)
        deathball.Size = Vector3.new(12.2, 12.2, 12.2)
        wait(0.1)
        deathball.Size = Vector3.new(13.2, 13.2, 13.2)
        wait(0.1)
        deathball.Size = Vector3.new(14.2, 14.2, 14.2)
        wait(0.1)
        deathball.Size = Vector3.new(15.2, 15.2, 15.2)
        wait(0.1)
        deathball.Size = Vector3.new(16.2, 16.2, 16.2)
        wait(0.1)
        deathball.Size = Vector3.new(17.2, 17.2, 17.2)
        wait(0.1)
        deathball.Size = Vector3.new(18.2, 18.2, 18.2)
        wait(0.1)
        deathball.Size = Vector3.new(19.2, 19.2, 19.2)
        wait(0.1)
        deathball.Size = Vector3.new(20.2, 20.2, 20.2)
        wait(3)
        deathball.Transparency = 0.4
        wait(0.1)
        deathball.Transparency = 0.5
        wait(0.1)
        deathball.Transparency = 0.6
        wait(0.1)
        deathball.Transparency = 0.7
        wait(0.1)
        deathball.Transparency = 0.8
        wait(0.1)
        deathball.Transparency = 0.9
        wait(0.1)
        deathball:Destroy()
        player.Character.Torso.Anchored = false
        player.Character.Humanoid.MaxHealth = 100
        player.Character.Humanoid.Health = 100
    end
end)

Thank you for the help!

1 answer

Log in to vote
1
Answered by
acecateer 130
10 years ago
player = game.Players.LocalPlayer
player:GetMouse().KeyDown:connect(function(key)
    if string.lower(key) ==  "q" then
        deathball = Instance.new("Part", Workspace) --You didn't put deathball in workspace
        mesh = Instance.new("SpecialMesh")
        mesh.Parent = deathball
        mesh.MeshType = "Sphere"
        deathball.BrickColor = BrickColor.new("BrickColor Name")  --Or BrickColor.new((Color3.new(0,0,0))
        player.Character.Humanoid.MaxHealth = math.huge
 player.Character.Humanoid.Health = 9e9
        deathball.CFrame = player.Character.Torso.CFrame
        deathball.Size = Vector3.new(1.2, 1.2, 1.2)
        wait(0.1)
        deathball.Size = Vector3.new(2.2, 2.2, 2.2)
        wait(0.1)
        deathball.Size = Vector3.new(3.2, 3.2, 3.2)
        wait(0.1)
        deathball.Size = Vector3.new(4.2, 4.2, 4.2) 
        wait(0.1)
        deathball.Size = Vector3.new(4.2, 4.2, 4.2) 
        wait(0.1)
        deathball.Size = Vector3.new(5.2, 5.2, 5.2) 
        deathball.Touched:connect(function(hit)
            if hit.Parent:FindFirstChild("Humanoid") then
                hit.Parent.Humanoid:TakeDamage(100) --If they have a forcefield then they will not be damaged.
            end
        end)
    end
end)

Edit: I meant to put TakeDamage, not 'Damage'. I derped.

0
There we're a few errors but i fixed them, thanks!! :D Grenaderade 525 — 10y
0
:D acecateer 130 — 10y
0
WAIT Grenaderade 525 — 10y
0
More errors, i edited my question Grenaderade 525 — 10y
Ad

Answer this question