local teleportModule = require(game.ServerScriptService.TeleportModule)
local doorModel = script.Parent
local door = doorModel.Door
local destination = doorModel.Destination
local givescript = doorModel.Money
deBounce = false
waitDelay = 1
door.Touched:Connect(function(hit)
if deBounce == false then
deBounce = true
-- Get Character
local character = hit.Parent
-- Check if Character and Humanoid Health > 0
if character:FindFirstChild("Humanoid") and character:FindFirstChild("Humanoid").Health > 0 then
local player = game.Players:GetPlayerFromCharacter(character)
teleportModule.teleportPlayer(player, destination) -- Trigger Module
player.leaderstats.Money.Value = player.leaderstats.Money.Value + 100 --Don't use local player, since you only use local player for local scripts(I assume this is a normal script)
end
wait(waitDelay)
deBounce = false
end
end)
givescript.Disabled = false
wait(3)
givescript.Disabled = true