I need help with script

So I have made a script but what I need it to do it doesn’t do it so can you help me I need it to when a block is clicked a block slides to a new position.
here is the script it have no errors

local Water = workspace.wate
End = game.Workspace.Wate.Finish
bodyposition = game.Workspace.Wate.Water.BodyPosition

Water.ClickDetector.MouseClick:Connect(function(Player)
bodyposition.Position = Water.Position

end)

Can someone please help me to make it work and it is in too models so do I have to put it in one.

2 Likes

Is this “Water” object anchored?

1 Like

Yes it is I have checked it just now and yes

Anchored parts ignore physics entirely, so it won’t be moved by a physics force like BodyPosition.

1 Like

So should I take it off anchor but if I do how will I keep it where I want to it will just pop to the top of the platform.

BodyPosition will keep it relatively locked to the given position. But it really depends on what you’re trying to do and how.

Thanks for you help I’ll try now

I tried it and it still didn’t work could you maybe show a video on how to do it or screenshots
or provide a link to a tutorial on how to do if you can then many thanks.

Do you get any errors? char(30)

No I don’t have any errors I have checked and nothing is wrong.

The script makes no sense but I will try to help. Really you should get a script, which works well; like a Follow Brick; and mod it…

First you must make sure that your BodyPosition’s paramaters (P, D, Pos) are high enough to float this unanchored boat.

A better scriot:
(1) Follow Brick - Roblox

GL

You don’t show where you are calling this function. Are you?

No sorry I have just started learning scripting so I thought I got it right Do you think you could do a video or take screenshots on how to do this if you don’t know what I need done Please say and ill try tell you in the best way possible.

Take the script in that link, I sent you.

Read every line. Search words you don’t know, Here:

Path (roblox.com)
or here

Lua: reference manuals

until u know why every line is there.

Take the script apart and put it back together again. Change every number in the script to see what they do:

You will become an expert at BodyPosition and BodyGyro…

Do you check If you type Its name correctly? like uppercase/lowercase Wate or wate and make sure that the part you’re trying to move Isn’t Anchored.

This should work I guess.

local Water = workspace.Wate
local End = game.Workspace.Wate.Finish --what is this?
local bodyposition = workspace.Wate.Water.BodyPosition

Water.ClickDetector.MouseClick:Connect(function(Player)
bodyposition.Position = Water.Position
end)

Ok so I looked at what you told me to do and I also watched some videos on it and here is the script so far I got rid of the body position but what I got does work but it only prints a word
the only help I need now is how to make it change its position when clicked or go 1 stud every second till it gets to a height

local ClickDetector = script.Parent.ClickDetector

ClickDetector.MouseClick:Connect(function(PlayerWhoClicked)
print(“Clikced On ClikcDetector”)
game.Workspace.Water.position = Random

end)