#Can someone help me add a teleporting system to my script

1 messages · Page 1 of 1 (latest)

serene kiln
#

I have most of the scripting down but i cannot figure this teleporting out

#

This is the script btw

pliant surgeBOT
#

studio** You are now Level 4! **studio

serene kiln
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local remotes = ReplicatedStorage:WaitForChild("ShoppingRemotes")
local updateTimer = remotes:WaitForChild("UpdateTimer")
local updatePoints = remotes:WaitForChild("UpdatePoints")
local assignIngredient = remotes:WaitForChild("AssignIngredient")
local roundEnded = remotes:WaitForChild("RoundEnded")
local updatePodium = remotes:WaitForChild("UpdatePodium") -- For avatars

local foodFolder = workspace:WaitForChild("FoodItems")

local ROUND_TIME = 60
local INTERMISSION_TIME = 25
local POINTS_PER_ITEM = 100

local foodNames = {
"Apples", "Bananas", "Bread", "Butter", "Carrots",
"Eggs", "Cheese", "Rice", "Pasta", "TomatoSauce",
"Chicken", "Yogurt", "Cereal", "Milk"
}

local assignedItems = {}

-- Create leaderstats for new players
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local points = Instance.new("IntValue")
points.Name = "Points"
points.Value = 0
points.Parent = leaderstats

end)

-- Handle correct food pickups
for _, item in ipairs(foodFolder:GetChildren()) do
if item:IsA("BasePart") and item:FindFirstChildOfClass("ProximityPrompt") then
item.ProximityPrompt.Triggered:Connect(function(player)
local expectedItem =

#

assignedItems[player]
if expectedItem and expectedItem == item.Name then
player.leaderstats.Points.Value += POINTS_PER_ITEM
updatePoints:FireClient(player, player.leaderstats.Points.Value)

            -- Assign new item
            local newItem = foodNames[math.random(1, #foodNames)]
            assignedItems[player] = newItem
            assignIngredient:FireClient(player, newItem)
        end
    end)
end

end

-- Game loop
while true do
-- Intermission
for i = INTERMISSION_TIME, 0, -1 do
for _, player in ipairs(Players:GetPlayers()) do
updateTimer:FireClient(player, "Intermission: " .. i)
end