Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.