R6 vs r15 problem

This is a current script I am using from this youtube tutorial.

He is using r15, but I am using r6, How would i make the script detect “Right Arm”?

-- local Projectile = Fireball:Clone()
	game.Debris:AddItem(Projectile,15)
	PhysicsService:SetPartCollisionGroup(Projectile, "Projectiles")
	Projectile.Position = plr.Character("Right Arm").Position+Vector3.new(0,1,0)
	Projectile.Velocity = CFrame.new(Projectile.Position, MousePos).LookVector*Speed
	Projectile.Size = Vector3.new(Size,Size,Size)
	Projectile.Parent = game.Workspace.EffectStorage
	Projectile.PointLight.Range = Size*5
4 Likes

note that the Projectile.Position = plr.Character("Right Arm").Position+Vector3.new(0,1,0) code is me trying to fix it,

1 Like

plr.Character["Right Arm"]

oh, i did not know it was case sensitive like that. Thank you again!

1 Like

Not case sensitive, but you got the wrong type of parantheses.

1 Like

Hm, it still dosent work. Here is my script for refernece…

local Event = game.ReplicatedStorage:WaitForChild("remotes")
local FireballEvent = Event:WaitForChild("Fireball")
--Services--
local PhysicsService = game:GetService("PhysicsService")
--Objects--
local Fireball = script:WaitForChild("Fireball")
local FireAOE = script:WaitForChild("FireAOE")
local Explosion = script:WaitForChild("Explosion")
FireballEvent.OnClientEvent:Connect(function(plr,MousePos,Speed,Size)
	local Projectile = Fireball:Clone()
	game.Debris:AddItem(Projectile,15)
	PhysicsService:SetPartCollisionGroup(Projectile, "Projectiles")
	Projectile.Position = plr.Character["Right Arm"].Position+Vector3.new(0,1,0)
	Projectile.Velocity = CFrame.new(Projectile.Position, MousePos).LookVector*Speed
	Projectile.Size = Vector3.new(Size,Size,Size)
	Projectile.Parent = game.Workspace.EffectStorage
	Projectile.PointLight.Range = Size*5

	Projectile.Touched:Connect(function(hit)
		if hit:IsDescendantOf(plr.Character) or hit:IsDescendantOf(game.Workspace.EffectStorage) then return end
		if Projectile:FindFirstChild("Touched") then return end

		local RaycastParam = RaycastParams.new()
		RaycastParam.FilterType = Enum.RaycastFilterType.Blacklist
		RaycastParam.FilterDescendantsInstances = {game.Workspace.EffectStorage}
		local RaycastResult = game.Workspace:Raycast(Projectile.Position, Vector3.new(0,-(Size/2+1),0),RaycastParam)
		if RaycastResult then
			local TC = Instance.new("BoolValue",Projectile)
			TC.Name = "Touched"
			Projectile.Anchored = true
			Projectile.CanCollide = false
			Projectile.Position = RaycastResult.Position
			Projectile.Attachment.Fire.Enabled = false
			game.Debris:AddItem(Projectile,2)

			local FireZone = FireAOE:Clone()
			FireZone.Size = Vector3.new(Size*6,1,Size*6)
			FireZone.Position = RaycastResult.Position
			FireZone.CFrame = CFrame.new(FireZone.Position, FireZone.Position+RaycastResult.Normal)*CFrame.Angles(math.rad(-90),0,0)
			FireZone.Parent = game.Workspace.EffectStorage
			game.Debris:AddItem(FireZone,5)
			spawn(function()
				task.wait(2)
				FireZone.Fire.Enabled = false
			end)

			local Exp = Explosion:Clone()
			Exp.Position = RaycastResult.Position
			Exp.Parent = game.Workspace.EffectStorage
			game.Debris:AddItem(Exp,3)
			spawn(function()
				task.wait(1)
				Exp.Fire.Enabled = false
			end)
		end

	end)
end)

i may be missing something however, let me check.

it works, but it dosent fire it as a projectile. it does this
image

It has something to do with the projectile.velocity, but i cant figure out

1 Like

fixed it, nvm it was an anchoring problem. thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.