Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to modify a tools "GripPos" ingame by script?

Alright, I'm trying to make a spear which will jab from scratch, but have encountered a bit of an issue -- how do I deal with "animating" a tool through the GripPos rotation options?

I'm currently using this as my script --

local debouncea = false
local gripos = script.Parent.GripPos

local damage = 55

script.Parent.Activated:connect(function()
	print("Running")
	if not debouncea then
		debouncea = true
		for i = 1,4 do
			print(i)
			gripos = CFrame.new(gripos.X, gripos.Y, (script.Parent.GripPos.Z + -.2))
			wait()
		end
		
		wait(.25)		
		
		for i = 1,4 do
			gripos = CFrame.new(gripos.X, gripos.Y, (script.Parent.GripPos.Z - -.2))
			wait()
		end
		
		debouncea = false
	end
end)

I'm not very good with tools, and the wiki lacked in-depth documentation on this subject. Chances are, I'm just approaching this the wrong way. This isn't doing anything (except the prints are just fine).

Thanks for reading, and I hope to find a solution!

1 answer

✓ Accepted answer

The problem here is that when you are trying to change the 'gripos' you are only changing the variable, try script.Parent.GripPos = CFrame.new(gripos.X,gripos.Y,(script.Parent.GripPos.Z - -.2))

1 comment

0

This specifically didn't give me the answer exactly, however, it led me down the right path to find it. Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.