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

Problems with CFrame and ClickDetector, Any Help?

When I click on the block, it is should move back by 1 stud, but it wont. Any Help?

script.Parent.ClickDetector.RightMouseClick:connect(function()
	script.Parent.CFrame = CFrame.new(script.Parent.Position.X - 1, script.Parent.Position.Y, script.Parent.Position.Z)
end)

2 comments

0

And what does it do instead?

0

Question is your script disabled?

2 answers

✓ Accepted answer

Yeah I agree with raspyjessie. Here is your revised script.

script.Parent.ClickDetector.MouseClick:connect(function()
    script.Parent.CFrame = CFrame.new(script.Parent.Position.X - 1, script.Parent.Position.Y, script.Parent.Position.Z)
end)

3 comments

1

Why downvote? I just rewrote the script. You didnt have to vote at all.

0

Thank you

0

I profer this method to the other one!

So i tried some things out. And got it to work in a different way. Try this

function RightClick()
    script.Parent.CFrame = CFrame.new(script.Parent.Position.X - 1, script.Parent.Position.Y, script.Parent.Position.Z)
end
script.Parent.ClickDetector.RightMouseClick:connect(RightClick)

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