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

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

Asked by
RoboFrog 400 Moderation Voter
10 years ago

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 --

01local debouncea = false
02local gripos = script.Parent.GripPos
03 
04local damage = 55
05 
06script.Parent.Activated:connect(function()
07    print("Running")
08    if not debouncea then
09        debouncea = true
10        for i = 1,4 do
11            print(i)
12            gripos = CFrame.new(gripos.X, gripos.Y, (script.Parent.GripPos.Z + -.2))
13            wait()
14        end
15 
View all 25 lines...

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

Log in to vote
3
Answered by
Muoshuu 580 Moderation Voter
10 years ago

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))

0
This specifically didn't give me the answer exactly, however, it led me down the right path to find it. Thanks! RoboFrog 400 — 10y
Ad

Answer this question