everything works perfectly except for when I drive the car into the garage, the gui pops up for everyone, not just the driver. how can I fix this?

local lp = game.Players.LocalPlayer
game.Workspace.TriggerCarShop.Touched:Connect(function(part)
	CarThatTouched = part:FindFirstAncestor("Car")
	local customize = CarThatTouched:FindFirstChild("CanCustomize")
	local carType = CarThatTouched:FindFirstChild("CarType")
	local thumbnailid = CarThatTouched:FindFirstChild("ThumbnailID")
	local char = lp.Character
	char.Parent = CarThatTouched
	local humInCar = char:FindFirstChild("Humanoid")
	local charInCar = humInCar.Parent
	local plrInCar = game.Players:GetPlayerFromCharacter(charInCar)
    if customize.Value == true and carType ~= nil then 
		script.Parent.Enabled = true
		script.Parent.MainFrame.CarDetected.CarDetectedText.Text = "Car: "..carType.Value
		script.Parent.MainFrame.CarDetected.Thumbnail.Image = "rbxassetid://"..thumbnailid.Value
	elseif customize.Value == false then
		local frame = script.Parent.Parent.Error.TweenedFrame
		frame.Error.Text = "This car is not customizable yet."
  	 	frame:TweenPosition(UDim2.new(0.5, -15,0.5, -37), 'Out', 'Quad', 1)
   		wait(4)
		frame:TweenPosition(UDim2.new(1.5, -15,0.5, -37), 'Out', 'Quad', 1)
		wait(1)
		frame.Position = UDim2.new(-.5,-15,.5,-37)
	end
end)

4 comments

0

Is the game filtering enabled?

0

Nope, don't have understanding of RemoteEvents and things like that.

0

use a teleport script m8 and teleport it to the car seat lol

0

what