#can anybody help its basic luau but im confused pls :(

1 messages · Page 1 of 1 (latest)

chilly forge
#

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)```
#

I made this script by myself without any tutorial im looking for opinions on how to do it

#

right

timid dawn
#

dont use tweenposition, its deprecated

#

use tweenservice

chilly forge
#

i tried but

#

it would let me use the goal

#

let me send you my older version of this script

timid dawn
#

use game players localplayer PlayerGui instead of startergui

chilly forge
#

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)```
timid dawn
#

since startergui only updates when u die

chilly forge
#

i want this to tween everytime the player clicks the door without the item

#

this is my explorer

#

nvm i got it