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

Is somthing wrong with my variables or the variables are right and im coding rong?

local pully_pos = -28.688, 9.34, -46.691
local pully2_pos = -28.688, -44.851, -46.691
local pully = workspace.pully
local pully2 = workspace.pully_in_pulled_position




local function pull_up_then_down()
	pully2:SetPrimaryPartCFrame(CFrame.new(pully_pos))
	pully:SetPrimaryPartCFrame(CFrame.new(pully2_pos))
	wait(2)
	pully:SetPrimaryPartCFrame(CFrame.new(pully_pos))
	pully2:SetPrimaryPartCFrame(CFrame.new(pully2_pos))
end
	 
script.Parent.ClickDetector.MouseClick:Connect(pull_up_then_down)

1 answer

✓ Accepted answer

Your variable declarations, for the most part, aren't syntactically contradicting, and follow normal conventions. However, your first two aren't going to allocate properly, as there are multiple data pieces that are trying to fit into one variable, which will cause an issue.

By studying your program, I can assume you're trying to store a Positional mark, which we can actually press into a Vector3. This will resolve the problem:

local pully_pos = Vector3.new(-28.688, 9.34, -46.691)
local pully2_pos = Vector3.new(-28.688, -44.851, -46.691)
local pully = workspace.pully
local pully2 = workspace.pully_in_pulled_position

local function pull_up_then_down()
    pully2:SetPrimaryPartCFrame(CFrame.new(pully_pos))
    pully:SetPrimaryPartCFrame(CFrame.new(pully2_pos))
    wait(2)
    pully:SetPrimaryPartCFrame(CFrame.new(pully_pos))
    pully2:SetPrimaryPartCFrame(CFrame.new(pully2_pos))
end

script.Parent.ClickDetector.MouseClick:Connect(pull_up_then_down)

2 comments

0

YOU SCARE ME WITH THAT REP

0

LOL, Thank you very much;)

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