I can see traces of other programming languages in that script. So first, you need to know what is the procedure of functions. Like, instead of do thing until thing, in lua, it is repeat thing until thing. Second thing, how to set properties. Third, better ways of doing thigs. Rotation isn't using anymore in favor of CFrame, and TweenService would be a better use instead of repeat until. Here is the script, and I'll link api reference for you, as I can't explain everything here.
local tweenService = game:GetService("TweenService")
local part = game.Workspace.Existing1
local tweenInfo = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In
)
local tween = tweenService:Create(part,tweenInfo,{CFrame = CFrame.Angles(math.rad(-7.5))})
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.WalkSpeed = 0
end
tween:Play()
end)
TweenInfo
TweenService
CFrame property
CFrame constructor
math (scroll down to see math.rad usage)
EasingStyle
EasingDirection
I think that's all. Hope this was helpful.
2 comments
When making a variable make sure to have the word "Local" before naming it. For instance, your first variable should be Local Rotation = workspace.Existing1.Rotation.Vector3.new(0, 157.5, 0)
local Rotation, notLocal Rotation