Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(SOLVED) im trying to make a door that opens when u touch an invisible part on the ground help?

Asked by 2 years ago
Edited 2 years ago
local model = script.Parent

local trigger = model.trigger

local main = model.main

local activated = false

local TweenService = game:GetService("TweenService")

local tweeninfo = TweenInfo.new(

    model.speed.Value, 
    Enum.EasingStyle.Quart,
    Enum.EasingDirection.Out,
    0,
    true,
    0

)

local function open(otherPart)
    local player = game.Players:FindFirstChild(otherPart.Parent.Name)
        if player and not activated then
        activated = true
        local tweendoor = TweenService:Create(door, tweeninfo, {Position = model.target.Position})

        tweendoor:play()


        tweendoor.Completed:Wait()

        activated = false
    end
end

local function verify()
    local function OnTouched(Touched)
        local Player1 = game:GetPlayerFromCharacter(Touched.Parent)
        if Player1 then
            local Tool = Player1.Backpack.tool
            Tool.Equipped:Connect(function(open)
            end)
        end-- Execute the needed.
        end
    end



trigger.Touched:Connect(verify)

and the tool giver

local tool = game.ServerStorage["Tool"]-- Change this to the name of the item
local giver = script.Parent
local canGive = false

local function GiveTool (player)
    if canGive == false then
        local clone = tool:Clone()
        clone.Parent = player.Backpack
        wait(1)
        canGive = false
    end
end

giver.ClickDetector.MouseClick:Connect(function(player)
    GiveTool(player)
end)

and litteraly nothing is WORKEING DDSADSADSDSADSADSAD SAd

1 answer

Log in to vote
0
Answered by 2 years ago

yall-- it was the door part(wich dosent exist) and i changed it to main and it now works

Ad

Answer this question