Hi other Developers,
I am relativity new to Roblox studio and I keep running across to this error and I don’t know how to fix it.
What do you want to achieve? I want to move the Metal Gate upwards with TweenService when the button is pressed (the Part varible)
This is the Error I keep getting ^^
This is the Current code i have:
–// Setting the Varibles for Instance Itself
local Part = script.Parent
local ClickDetector = Part:WaitForChild(“ClickDetector”)
local MetalGate = Part.Parent:WaitForChild(“MetalGate”)
local CoolDown = false
print(MetalGate)
–// Creating a movement animation for the door
local TweenService = game:GetService(“TweenService”)
local Info = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 1, true)
local GatePosition = MetalGate.Position
local NewGatePos = GatePosition + Vector3.new(0, 7, 0)
local NewPosition = {
GatePosition = NewGatePos
}
local MoveDoorUp = TweenService:Create(MetalGate, Info, NewPosition)
ClickDetector.MouseClick:Connect(function()
if CoolDown == false then
Part.Color = Color3.fromRGB(86, 255, 74)
task.wait(1)
MoveDoorUp:Play()
task.wait(3)
CoolDown = false
end
end)
Help would be very appreciated!