Скрипт: local Gate = script.Parent local Player = game:GetService("Players") local Tycoon = workspace.Tycoon1 local collector = workspace.Tycoon1.CashGiver.Collect local function onHit(hit) local Player = Player:GetPlayerFromCharacter(hit.Parent) if not Player then return end Tycoon.Owner.Value = Player collector.Transparency = 0 collector.CanTouch = true script:Destroy() end Gate.Touched:Connect(onHit) Помогите пожалуйста с ошибкой.
local Gate = script.Parent
local Player = game:GetService("Players")
local Tycoon = workspace.Tycoon1
local collector = workspace.Tycoon1.CashGiver.Collect
local function onHit(hit)
local Player = Player:GetPlayerFromCharacter(hit.Parent)
if not Player then return end
Tycoon.Owner.Value = Player
collector.Transparency = 0
collector.CanTouch = true
script:Destroy()
end
Gate.Touched:Connect(onHit)
Помогите пожалуйста с ошибкой.