local plank = game.Workspace.Door
local cd = plank.ClickDetector
local warn = game.StarterGui.LALA.TextLabel
local ts = game:GetService("TweenService")
local function use(player)
local hastoolPlank = player.Backpack:FindFirstChild("Plank")
if hastoolPlank then
plank.CanCollide = true
plank.Transparency = 0
hastoolPlank:Destroy()
else
if not plank.CanCollide then
local PlankWarn = warn:Clone()
PlankWarn:TweenPosition(UDim2.new(0.39, 0,0.9, 0),
1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.In,
0,
true
)
wait(4)
PlankWarn:Destroy()
end
end
end
cd.MouseClick:Connect(use)```
#can anybody help its basic luau but im confused pls :(
1 messages · Page 1 of 1 (latest)
I made this script by myself without any tutorial im looking for opinions on how to do it
right
i tried but
it would let me use the goal
let me send you my older version of this script
use game players localplayer PlayerGui instead of startergui
local plank = game.Workspace.Door
local cd = plank.ClickDetector
local warn = game.StarterGui.LALA.TextLabel
local ts = game:GetService("TweenService")
local goal =
goal.Position = UDim2(0.388, 0,0.847, 0)
goal.Visible = true
local info = TweenInfo.new(
1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.In,
0,
true
)
local function use(player)
local hastoolPlank = player.Backpack:FindFirstChild("Plank")
if hastoolPlank then
plank.CanCollide = true
plank.Transparency = 0
hastoolPlank:Destroy()
else
if not plank.CanCollide then
local PlankWarn = warn:Clone()
PlankWarn.Visible = true
local Planktween = ts:Create(PlankWarn, info, goal)
Planktween:Play()
wait(4)
PlankWarn:Destroy()
end
end
end
cd.MouseClick:Connect(use)```
since startergui only updates when u die