Gaster blaster problem

@JackscarIitt for you

while true do
local p = Instance.new(“Part”, script.Parent)
p.Name = “ChargingAura”
p.Anchored = true
p.CFrame = script.Parent.BeamCharging.CFrame
p.Shape = Enum.PartType.Ball
p.Size = Vector3.new(script.Parent.BeamCharging.Size.X * 2.5, script.Parent.BeamCharging.Size.X * 2.5, script.Parent.BeamCharging.Size.X * 2.5)
p.Material = Enum.Material.Neon
p.Transparency = 1
p.CanCollide = false
script.Parent.Beamer.Charge:Play()
for i = 1,20 do
p.Size = p.Size - Vector3.new(script.Parent.BeamCharging.Size.X * 0.075, script.Parent.BeamCharging.Size.X * 0.075, script.Parent.BeamCharging.Size.X * 0.075)
p.Transparency = p.Transparency - 0.0375
script.Parent.Jaws.CFrame = script.Parent.Jaws.CFrame * CFrame.Angles(math.rad(2.25), math.rad(0), math.rad(0))
wait(0.025)
end
game.Debris:AddItem(p, 0.5)
wait(0.5)
local c = Instance.new(“Part”, script.Parent)
local e = Instance.new (“SpecialMesh”)
e.MeshType = Enum.MeshType.Sphere
e.Parent = c
c.Name = “GasterBeam”
c.Color = BrickColor.new(“Gold”).Color
c.Anchored = true
c.Shape = Enum.PartType.Cylinder
c.Size = Vector3.new(0, script.Parent.BeamCharging.Size.Y * 7, script.Parent.BeamCharging.Size.Z * 7)
c.Material = Enum.Material.Neon
c.Transparency = 0
c.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
hit.Parent:FindFirstChild(“Humanoid”):TakeDamage(script.Parent.Damage.Value)
end
end)
script.Parent[“Right Eye”].Transparency = 1
script.Parent.Beamer.Shoot:Play()
for i = 1,10 do
c.Size = c.Size + Vector3.new(script.Parent.BeamCharging.Size.X * 10, script.Parent.BeamCharging.Size.Y / 10, script.Parent.BeamCharging.Size.Z / 10)
c.Transparency = c.Transparency + 0.025
c.CFrame = script.Parent.BeamCharging.CFrame + script.Parent.BeamCharging.CFrame.RightVector * ((c.Size.X / 2) + (script.Parent.BeamCharging.Size.X * 1.5))
c.CanCollide = false
wait(0.00001)
end
for i = 1 , 2 do
	for i = 1,10 do
		c.Size = c.Size - Vector3.new(-(script.Parent.BeamCharging.Size.X * 2), script.Parent.BeamCharging.Size.Y / 20, script.Parent.BeamCharging.Size.Z / 20)
		c.CFrame = script.Parent.BeamCharging.CFrame + script.Parent.BeamCharging.CFrame.RightVector * ((c.Size.X / 2) + (script.Parent.BeamCharging.Size.X * 1.5))
		c.Transparency = c.Transparency - 0.025
		wait(0.025)

	end
	for i = 1,10 do
		c.Size = c.Size + Vector3.new(script.Parent.BeamCharging.Size.X * 2, script.Parent.BeamCharging.Size.Y / 10, script.Parent.BeamCharging.Size.Z / 10)
		c.CFrame = script.Parent.BeamCharging.CFrame + script.Parent.BeamCharging.CFrame.RightVector * ((c.Size.X / 2) + (script.Parent.BeamCharging.Size.X * 1.5))
		c.Transparency = c.Transparency + 0.025
		wait(0.00001)

	end
	wait()
end
for i = 1,10 do
	c.Size = c.Size - Vector3.new(-(script.Parent.BeamCharging.Size.X * 2), script.Parent.BeamCharging.Size.Y / 4, script.Parent.BeamCharging.Size.Z / 4)
	c.CFrame = script.Parent.BeamCharging.CFrame + script.Parent.BeamCharging.CFrame.RightVector * ((c.Size.X / 2) + (script.Parent.BeamCharging.Size.X * 1.5))
	c.Transparency = c.Transparency - 0.025
	wait(0.00001)

end

game.Debris:AddItem(c, 0)
script.Parent["Right Eye"].Transparency = 0
for i = 1,20 do
	script.Parent.Jaws.CFrame = script.Parent.Jaws.CFrame * CFrame.Angles(math.rad(-2.25), math.rad(0), math.rad(0))
	wait(0.00001)
end
script.Parent.Beamer.Bling:Play()
wait(0.5)

Ow

	c.Touched:Connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Creator") then
			if hit.Parent.Creator.Value ~= Caster then 
				hit.Parent:FindFirstChild("Humanoid"):TakeDamage(script.Parent.Damage.Value)
			end
		end
	end)
	

All I just did was add 1 sanity check in these lines here, the Creator ObjectValue should be parented inside every Character when they respawn, & when someone casts the blaster that’s what you should check if the person that touched it is not equal to the caster to prevent them from receiving the damage

Keep in mind that you have to make these changes yourself, cause I don’t know how the rest of your code is made when the Blaster gets cast

1 Like

uhhhh i got an error. should i give it a variable or something?

The Caster variable should be a one, yes

You have to reference it by inserting an ObjectValue in the Blaster, then name it “Creator”

local Cast = script.Parent.Creator

When you clone the blaster, you should also set the value to the Caster’s Character for it to implement its sanity checks

ok now it is not even doing anything. it just spawns in and after a few seconds it disappears.

maybe time to stop here, I don’t want to overwhelmed people.

Insted of 9223372036854775807 you should do 100 since it’s the max health for a player.

1 Like

Yep i see that this post is made in 2021 but i still will give an answer.
Try inserting a string value into blaster gaster, and when player spawns it it’s gonna put his username into the string value. Then do a check, if damaged player is NOT having this username, or else he is blaster gaster’s creator, and we do not want to damage him as you said.

c.Touched:Connect(function(hit) --Player touches blast or whatever should damage players
    if hit.Parent:FindFirstChild("Humanoid") then --Checking if he has humanoid so we make sure it's rig
        if script.Parent.Creator.Value ~= hit.Parent.Name then --Check if Creator value inside gaster blaster isn't equal to the hit player's username, so we check if it's not blaster gaster creator
            hit.Parent.FindFirstChild("Humanoid"):TakeDamage(script.Parent.Damage.Value) --And finally we damage player, but not creator.
        end
    end
end)