Game doesn't work for some people, but works for others and only works for me in Roblox Studio

Sorry if I put this in the wrong area, I am still very new to the Developer forum and this is my very first topic.

  1. What do you want to achieve? Keep it simple and clear!
    My game to work for all players on all platforms, including myself.

  2. What is the issue? Include screenshots / videos if possible!
    My game is broken for certain people including myself, but working for others. It’s really confusing and Roblox support didn’t work because all it did was show me articles that had literally nothing to do with my question. Whenever I play the game on the Roblox player, the server scripts don’t work and I can noclip through the entire map (I have no scripts that allow the player to noclip or the map uncollidable). Proximity prompts also don’t appear anymore. But in Roblox Studio it works, and I’ve had my friends play the game and share their screen to me so I can confirm it works for them, and it works just fine. The game is public, if you would like to play it to see if you get the bug the link is here: https://www.roblox.com/games/6348381121/Hungry-at-night.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I rewrote the entire game twice, but still it only works for certain people. I also checked the developer console both server and client, but no errors and all of the scripts seem to be working fine according to the developer console.

(files weren’t uploading so had to edit post)
This is what happens in the Roblox player:

This is what happens in Roblox Studio:

As you can see, in the Roblox Studio version I can interact with the proximity prompts and I have collision, but in the Roblox player version I have no collision, can’t interact with proximity prompts, and I glitch around the map.

This issue has been happening for a while, and I rewrote the entire game 2 different times but still the issue won’t work. I’ve emailed Roblox Support but it’s Roblox Support and that didn’t get me very far. I’ve searched the Forum for something like my issue, but on every post I came to it turned out to be a script error. I am very confused by this because the game works perfectly and as intended for certain people or for me when I run the game in Roblox Studio instead of the Roblox player. Any help is appreciated. Also, due to the sheer amount of scripts I have in the game I’ll only be showing the main client and server scripts. If you would like to see more, please let me know and I’ll show more.

--( Main Server Script )--
local proximityPromptService = game:GetService("ProximityPromptService")
local canBreakGlass = false
local canStart = true
local tweenService = game:GetService("TweenService")
local dialouge = {
	Start = {
		Status = "you wake up one night.... hungry... you must eat something...";
		Objective = "go to the kitchen and grab a pop tart"
	};
	Dark = {
		Status = "you realize it's too dark to see outside of your room and you don't want to wake up your parents.";
		Objective = "find a flashlight inside of your room"
	};
	FlashlightFound = {
		Status = "you found a flashlight, now you can go and get a pop tart";
		Objective = "go to the kitchen and grab a pop tart"
	};
	ToastPopTart = {
		Status = "";
		Objective = "toast pop tart in the toaster"
	};
	PowerOut = {
		Status = "oh no! the power is out and the toaster isn't working!";
		Objective = "find the main power box and re-enable the power"
	};
	PowerRestored = {
		Status = "the power is restored!";
		Objective = "toast pop tart in the toaster"
	};
	PopTartToasting = {
		Status = "the pop tart is now toasting...";
		Objective = "wait for the pop tart to toast"
	};
	PopTartToasted = {
		Status = "the pop tart is done.. time to dine";
		Objective = "go to bed and consume your tasty pop tart"
	};
	Sleep = {
		Status = "you go to sleep with your warm crunchy prize... the end!";
		Objective = ""
	};
	GlassBreak = {
		Status = "what in the world was that...???";
		Objective = ""
	};
	GlassBreakChoice = {
		Choice1 = "go to bed and check the noise out in the morning";
		Choice2 = "investigate the source of the noise"
	};
	Ignore = {
		Status = "you decide to check it out later...";
		Objective = "go to bed"
	};
	Investigate = {
		Status = "you decide to investigate the source of the noise";
		Objective = "check the house"
	};
	GoodEnding = "you go to bed and consume your tasty poptart";
	BadEnding = "you should have gone to bed.";
	SecretEnding = nil;
	
}

game.Players.PlayerAdded:Connect(function(player)
	repeat wait() until (player.Character or player.CharacterAdded:Wait())
	player:LoadCharacter()
	local character = (player.Character or player.CharacterAdded:Wait())
	local root = character:FindFirstChild("HumanoidRootPart")
	repeat wait() until root
	root.Position = workspace.Spawn.Position
	wait(2.5)
	local statusText = dialouge.Start.Status
	local objectiveText = dialouge.Start.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
end)

local function grabPopTart(prompt, player)
	if player then
		local character = (player.Character or player.CharacterAdded:Wait())
		if character then
			local humanoid = character:WaitForChild("Humanoid", 10)
			if humanoid then
				prompt.Parent.Parent.Grab:Play()
			end
		end
	end
end

local function grabToast(prompt, player)
	local character = player.Character
	if character then
		local humanoid = player.Character:FindFirstChild("Humanoid")
		if humanoid then
			workspace.House.Kitchen.Toaster.PopTartF.Transparency = 1
		end
	end
end

local function toast(prompt, player)
	local cookTime = 30
	local startColor = Color3.fromRGB(204, 142, 105)
	local endColor = Color3.fromRGB(132, 70, 33)
	local tweenService = game:GetService("TweenService")
	local tweenInfo = TweenInfo.new(cookTime, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
	local cook = tweenService:Create(workspace.House.Kitchen.Toaster.PopTart, tweenInfo, {Color = endColor})
	prompt.Parent.Parent.Start:Play()
	workspace.House.Kitchen.Toaster.PopTart.Color = startColor
	workspace.House.Kitchen.Toaster.PopTart.Transparency = 0
	workspace.House.Kitchen.Toaster.PopTartF.Transparency = 1
	workspace.House.Kitchen.Toaster.Interactive.Transparency = 1
	workspace.House.Kitchen.Toaster.InteractiveF.Transparency = 0
	cook:Play()
	wait(cookTime)
	workspace.House.Kitchen.Toaster.PopTart.Transparency = 1
	workspace.House.Kitchen.Toaster.PopTartF.Transparency = 0
	workspace.House.Kitchen.Toaster.Interactive.Transparency = 0
	workspace.House.Kitchen.Toaster.InteractiveF.Transparency = 1
	prompt.Parent.Parent.Finish:Play()
	game.ReplicatedStorage.ToastBread:FireClient(player)
end

game.ReplicatedStorage.GiveBread.OnServerEvent:Connect(function(player, prompt)
	local statusText = dialouge.ToastPopTart.Status
	local objectiveText = dialouge.ToastPopTart.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
	grabPopTart(prompt, player)
end)

game.ReplicatedStorage.ToastBreadF.OnServerEvent:Connect(function(player, prompt)
	local statusText = dialouge.PowerOut.Status
	local objectiveText = dialouge.PowerOut.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
	repeat wait() until workspace.PowerBox.Lever.toggle.Value == true
	local statusText = dialouge.PowerRestored.Status
	local objectiveText = dialouge.PowerRestored.Objective
	game.ReplicatedStorage.ToastBreadF:FireClient(player)
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
end)

game.ReplicatedStorage.ToastBread.OnServerEvent:Connect(function(player, prompt)
	local statusText = dialouge.PopTartToasting.Status
	local objectiveText = dialouge.PopTartToasting.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
	toast(prompt, player)
end)

game.ReplicatedStorage.ChoiceDecision.OnServerEvent:Connect(function(player, decision)
	if decision == 2 then
		workspace.StartDetector.CanCollide = true
		local door = workspace.House.Body.Doors.DoorRoom
		door.Hinge.CFrame = door.CloseHinge.CFrame
		door.Opened.Value = false
		door.Base.Prompt.OpenDoor.Enabled = false
		workspace.Barriers.Doorway1.CanCollide = false
		workspace.Barriers.Doorway2.CanCollide = false
		workspace.Barriers.Doorway3.CanCollide = false
		for _, v in pairs(workspace.House.Body.Doors:GetDescendants()) do
			if v:IsA("ProximityPrompt") then
				v.Enabled = true
			end
		end
		local statusText = dialouge.Investigate.Status
		local objectiveText = dialouge.Investigate.Objective
		game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
		game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
		workspace.House.MainRoom.Bed.Pillow.Attachment.Sleep.Enabled = true
	elseif decision == 1 then
		local statusText = dialouge.Ignore.Status
		local objectiveText = dialouge.Ignore.Objective
		game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
		game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
	end
end)

game.ReplicatedStorage.GiveToast.OnServerEvent:Connect(function(player, prompt)
	canBreakGlass = true
	local statusText = dialouge.PopTartToasted.Status
	local objectiveText = dialouge.PopTartToasted.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, false, false)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
	grabToast(prompt, player)
end)

game.ReplicatedStorage.OpenDoor.OnServerEvent:Connect(function(player, door, prompt)
	if door.Name == "DoorTrigger" then
		prompt.Enabled = false
		game.ReplicatedStorage.Cutscene:FireClient(player)
	end
end)

workspace.KitchenDetector.Touched:Connect(function(partHit)
	if partHit.Parent:IsA("Model") and canBreakGlass then
		canBreakGlass = false
		game.ReplicatedStorage.DisableFlashlight:FireAllClients()
		workspace.House.LivingRoom.TV.Front.TvOn.Value = false
		workspace.House.LivingRoom.TV.Front.Light.Light.Enabled = false
		workspace.House.LivingRoom.TV.Front.Screen.Decal.Transparency = 1
		wait(3)
		workspace.Glass:Play()
		wait(3)
		local statusText = dialouge.GlassBreak.Status
		local objectiveText = dialouge.GlassBreak.Objective
		game.ReplicatedStorage.StatusUpdate:FireAllClients(statusText, false, true)
		game.ReplicatedStorage.ObjectiveUpdate:FireAllClients(objectiveText)
		wait(3)
		game.ReplicatedStorage.EnableFlashlight:FireAllClients()
		game.ReplicatedStorage.Choice:FireAllClients(dialouge.GlassBreakChoice, true)
	end
end)

game.ReplicatedStorage.OpenDoor.OnServerEvent:Connect(function(player, door, prompt)
	if door.Name == "DoorRoom" and canStart == true then
		local statusText = dialouge.Dark.Status
		local objectiveText = dialouge.Dark.Objective
		game.ReplicatedStorage.StatusUpdate:FireAllClients(statusText, false, false)
		game.ReplicatedStorage.ObjectiveUpdate:FireAllClients(objectiveText, false, false)
		game.ReplicatedStorage.Begin:FireAllClients()
		prompt.Enabled = false
		canStart = false
	elseif door.Name == "DoorTrigger" then
		game.ReplicatedStorage.Cutscene:FireClient(player)
		workspace.Cam.CFrame = workspace.Cutscene1.CFrame
	end
end)

game.ReplicatedStorage.FlashlightGrab.OnServerEvent:Connect(function(player, prompt)
	local statusText = dialouge.FlashlightFound.Status
	local objectiveText = dialouge.FlashlightFound.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText, false, false)
	workspace.House.MainRoom.Flashlight.Transparency = 1
	workspace.Barriers.Flashlight.CanCollide = false
	workspace.House.Body.Doors.BackSlidingDoor.SlidingDoor.Interactive.Attachment.OpenBackDoor.Enabled = true
end)

game.ReplicatedStorage.Sleep.OnServerEvent:Connect(function(player)
	local statusText = dialouge.Sleep.Status
	local objectiveText = dialouge.Sleep.Objective
	game.ReplicatedStorage.StatusUpdate:FireClient(player, statusText, true, true)
	game.ReplicatedStorage.ObjectiveUpdate:FireClient(player, objectiveText)
end)

game.ReplicatedStorage.Done.OnServerEvent:Connect(function(player, text)
	player:Kick(text	)
end)

(NOTE: on the client, the reason I don’t do the prompt triggered on the server is because a previous issue made it so that the prompt triggered event was only firing on the server for certain people, similar to what’s going on right now. making it fire a remote event instead is an easier fix for me instead of making a whole post like I’m doing right now)

--( Main Client Script )--
local proximityPromptService = game:GetService("ProximityPromptService")

proximityPromptService.PromptTriggered:Connect(function(prompt)
	if prompt.Name == "PopTartsGrab" then
		game.ReplicatedStorage.GiveBread:FireServer(prompt)
		prompt.Enabled = false
		game.ReplicatedStorage.Poptart:Clone().Parent = workspace.CurrentCamera
		workspace.House.Kitchen.Toaster.Interactive.Attachment.CookPopTartF.Enabled = true
	elseif prompt.Name == "CookPopTartF" then
		game.ReplicatedStorage.ToastBreadF:FireServer(prompt)
		prompt.Enabled = false
		game.ReplicatedStorage.ToastBreadF.OnClientEvent:Connect(function()
			workspace.House.Kitchen.Toaster.Interactive.Attachment.CookPopTart.Enabled = true
		end)
	elseif prompt.Name == "CookPopTart" then
		game.ReplicatedStorage.ToastBread:FireServer(prompt)
		prompt.Enabled = false
		if workspace.CurrentCamera:FindFirstChild("Poptart") then
			workspace.CurrentCamera.Poptart:Destroy()
		end
		game.ReplicatedStorage.ToastBread.OnClientEvent:Connect(function()
			workspace.House.Kitchen.Toaster.Interactive.Attachment.GrabPopTart.Enabled = true
		end)
	elseif prompt.Name == "GrabPopTart" then
		game.ReplicatedStorage.GiveToast:FireServer(prompt)
		prompt.Enabled = false
		workspace.House.MainRoom.Bed.Pillow.Attachment.Sleep.Enabled = true
		game.ReplicatedStorage.PoptartToast:Clone().Parent = workspace.CurrentCamera
	elseif prompt.Name == "Sleep" then
		game.ReplicatedStorage.Sleep:FireServer(prompt)
		game.Players.LocalPlayer.PlayerGui.BlackScreen.Enabled = true
	elseif prompt.Name == "OpenBackDoor" then
		game.ReplicatedStorage.BackDoor:FireServer(prompt)
	elseif prompt.Name == "OpenPowerBox" then
		game.ReplicatedStorage.PowerBox:FireServer(prompt)
	elseif prompt.Name == "Power" then
		game.ReplicatedStorage.Power:FireServer(prompt)
	elseif prompt.Name == "ClosetLeft" then
		game.ReplicatedStorage.ClosetLeft:FireServer(prompt)
	elseif prompt.Name == "ClosetRight" then
		game.ReplicatedStorage.ClosetRight:FireServer(prompt)
	elseif prompt.Name == "FlashlightGrab" then
		game.Players.LocalPlayer.Character:WaitForChild("FlashlightEnabled").Value = true
		game.ReplicatedStorage.FlashlightGrab:FireServer(prompt)
		prompt.Enabled = false
		workspace.House.Kitchen.PopTarts.Part.Attachment.PopTartsGrab.Enabled = true
	elseif prompt.Name == "OpenDoor" then
		game.ReplicatedStorage.OpenDoor:FireServer(prompt.Parent.Parent.Parent, prompt)
	end
end)

game.ReplicatedStorage.Begin.OnClientEvent:Connect(function()
	workspace.House.MainRoom.BiFoldDoorCloset.BifoldDoorsLeftSide.Door.Prompt.Attachment:WaitForChild("ClosetLeft").Enabled = true
	workspace.House.MainRoom.BiFoldDoorCloset.BifoldDoorsRightSide.Door.Prompt.Attachment:WaitForChild("ClosetRight").Enabled = true
end)

game:GetService("RunService").RenderStepped:Connect(function()
	if workspace.PowerBox.Lever.toggle.Value == true then
		if workspace.House.Kitchen.Toaster.Interactive.Attachment.CookPopTartF.Enabled == true then
			workspace.House.Kitchen.Toaster.Interactive.Attachment.CookPopTartF.Enabled = false
			workspace.House.Kitchen.Toaster.Interactive.Attachment.CookPopTart.Enabled = true
		end
	end
end)

Any help is appreciated, I’m actually confused and I have no idea what to do.

I found a fix if anyone has a problem similar to mine. The issue was that I had a script that deleted the Animate script, and it broke the player. It caused only the humanoid root part to teleport for some people, making the game very unstable and glitching them everywhere.

2 Likes