What Happened to my Scripts

So i took some code from my other account and it doesn’t work what do i do?
because there is nothing wrong with my Scripts
and i completely took it from my game and the Scripts don’t work?
you might be wondering what is it Supposed to do right?
it was Supposed to be like the main menu piggy
help is appreciated :grinning:

Could you include snippets, maybe? We can’t help unless we know what’s going on.

2 Likes

Please give use a snippet of the code, if you do not do so, I am afraid that this post may never be resolved.

oh umm ok i will do that
i’m going to Show you every Script

Please do not show is every script. Please give us the snippet of the script causing the issue. If it is a contextual issue, give us a file download.

1 Like

ServerScriptService game Script =
local Replicated = game.ReplicatedStorage:WaitForChild(“Round”)

local RoundModule = require(script.RoundModule)

local PlayerModule = require(script.PlayerModule)

local Timer = Replicated.Timer

local Satus = Replicated.Status

local gameplayer = Replicated.Players

local function Intermission()

PlayerModule.ResetallPlayers()

gameplayer:ClearAllChildren()

while #gameplayer:GetChildren() < 1 do

wait(1)

end

RoundModule.Countdown(“Intermission”, 2)

end

local function StartGame()

PlayerModule.TeleportallPlayers(workspace.Spawn)

PlayerModule.CutsceneAll(“Chapter 1”, “Intro”)

RoundModule.Countdown(“Game”, 30)

PlayerModule.CutsceneAll(“Chapter 1”, “Outro”)

end

while true do

Intermission()

StartGame()

end

PlayerModule in game Script =
local playermodule = {}
local Replicated = game.ReplicatedStorage:WaitForChild(“Round”)
local Events = game.ReplicatedStorage:WaitForChild(“Remote”)

Events:WaitForChild(“Joinedgame”).OnServerEvent:Connect(function(Player)
local maker = Instance.new(“StringValue”, game.ReplicatedStorage.Round.Players)
maker.Name = Player.Name
maker.Value = “Alive”
end)

function playermodule.TeleportinglePlayer(PlayerName, TeleportLocation)
local gameplayer = game.Players:FindFirstChild(PlayerName)
if gameplayer then
local Character = gameplayer.Character or gameplayer.CharacterAdded:Wait()
Character.HumanoidRootPart.CFrame = TeleportLocation.CFrame
Events:WaitForChild(“ToggleMainFrame”):FireClient(gameplayer, false)
end
end

function playermodule.TeleportallPlayers(TeleportLocation)
for i, player in pairs(Replicated.Players:GetChildren()) do
playermodule.TeleportinglePlayer(player.Name, TeleportLocation)
end
end

function playermodule.ResetallPlayers()
for i, player in pairs(Replicated.Players:GetChildren()) do
local gameplayer = game.Players:FindFirstChild(player.Name)
if gameplayer then
gameplayer:LoadCharacter()
Events:WaitForChild(“ToggleMainFrame”):FireClient(gameplayer,true)
end
end
end

function playermodule.CutsceneAll(chapter, Cutscene)
for i, player in pairs(Replicated.Players:GetChildren()) do
local gameplayer = game.Players:FindFirstChild(player.Name)
if player.Value == “Alive” and gameplayer then
Events:WaitForChild(“ToggleCutscene”):FireClient(gameplayer, chapter, Cutscene)
end
end

local EventHandler
EventHandler = Events:WaitForChild("CutSceneFinished").OnServerEvent:Connect(function()
	script.CutSceneEnded:Fire()
	
	if EventHandler then
		EventHandler:Disconnect()
	end
end)

script.CutSceneEnded.Event:Wait()

end

game.Players.PlayerAdded:Connect(function(Player)
Events:WaitForChild(“ToggleMainFrame”):FireClient(Player, true)

Player.CharacterAdded:Connect(function(character)
	character:WaitForChild("Humanoid").Died:Connect(function()
		if Replicated.Players:FindFirstChild(Player.Name) then
			Replicated.Player:FindFirstChild(Player.Name).Value = "Dead"
		end
		
		Events:WaitForChild("ToggleMainFrame"):FireClient(Player,true)
	end)
end)

end)

return playermodule

RoundModule also in game Script =
local Roundmodule = {}

function Roundmodule.Countdown(status, clock)
local Replicated = game.ReplicatedStorage:WaitForChild(“Round”)
Replicated.Status.Value = status
Replicated.Timer.Value = clock
for i = clock, 1, -1 do
wait(1)
Replicated.Timer.Value = Replicated.Timer.Value - 1
end
wait(1)
end

return Roundmodule

StarterGui in a Screengui =
local gui = script.Parent
local MainFrame = gui.MainFrame
local Events = game.ReplicatedStorage:WaitForChild(“Remote”)
local camera = workspace.CurrentCamera
local Replicated = game.ReplicatedStorage:WaitForChild(“Round”)

MainFrame.PlayBtn.MouseButton1Click:Connect(function()
Events:WaitForChild(“Joinedgame”):FireServer()
MainFrame.Visible = false
gui.IntermissionFrame.Visible = true
local tween = game:GetService(“TweenService”)
tween:Create(camera, TweenInfo.new(1), {CFrame = workspace.MainCameraParts.CameraPart2.CFrame}):Play()
end)

Replicated.Timer.Changed:Connect(function()
if Replicated.Status.Value == “Intermission” then
gui.IntermissionFrame.Frame.IntText.Text = "Intermission " … Replicated.Timer.Value
else
gui.IntermissionFrame.Frame.IntText.Text = “The Game in Progress”
end
end)

Replicated.Players.ChildAdded:Connect(function(object)
if game.Players:FindFirstChild(object.Name) then
local player = game.Players:FindFirstChild(object.Name)
local playerimg = gui.IntermissionFrame.Frame.PlayerImage.Template:Clone()
local img = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size100x100)
playerimg.Image = img
playerimg.Text.Text = player.Name
playerimg.Name = player.Name
playerimg.Visible = true
playerimg.Parent = gui.IntermissionFrame.Frame.PlayerImage
end
end)

Events:WaitForChild(“ToggleMainFrame”).OnClientEvent:Connect(function(visible)
MainFrame.Visible = visible
if visible then
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = workspace.MainCameraParts.CameraPart
camera.CFrame = workspace.MainCameraParts.CameraPart.CFrame
else
gui.IntermissionFrame.Visible = false
camera.CameraType = Enum.CameraType.Custom
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
camera.CameraSubject = Character:WaitForChild(“Humanoid”)

	for index, playerImg in pairs(script.Parent.IntermissionFrame.Frame.PlayerImage:GetChildren()) do
		if playerImg:IsA("ImageLabel") and playerImg.Name ~= "Template" then
			playerImg:Destroy()
		end
	end
end

end)

the other Scripts work fine

Yeah… about this… Please use correct formatting, debugging this is impossible.

1 Like

Make should the script is in the correct location, and use the output to your advantage is all I can say. It’s really hard even for good scripters to read your stuff because we genuinely have no clue what you’re doing with all these unknown variables.

when i test there is no error in the output i think its a roblox Studio problem

What do you mean? How can it be a roblox studio problem? Just because there’s no error doesn’t mean it’s a studio problem.

1 Like