Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My script works perfectly inside roblox studio but not in an actual server?

I tried a lot of different methods but none worked.. Ignore The Numbers in the scripts, I didn't put them in my actual Scripts.

Here is the script I put in ServerScriptService.

local countdown = game:GetService("ReplicatedStorage"):WaitForChild("values"):WaitForChild("Countdown") local MapChoosenName = game:GetService("ReplicatedStorage"):WaitForChild("values"):WaitForChild("MapChooseName") local SideText = game:GetService("ReplicatedStorage"):WaitForChild("values"):WaitForChild("SideText") local defaultSpawn = game:GetService("Workspace"):WaitForChild("Main"):WaitForChild("Lobby"):WaitForChild("Spawnpoints") local cooldown = 1

while game:GetService("RunService").Heartbeat:Wait() do


01	for _,plr in next, game.Players:GetPlayers() do
02	 
03	    for i = 10,0,-1 do
04	        wait(1)
05	        countdown.Value = i
06	    SideText.Value = "Next Obby Soon.."
07	    if i == 0 then
08	        wait()
09	        print("Starting Obby")
10	        wait(cooldown)
11	        SideText.Value = " Aha! The obby is here! Gl! "
12	        local mapChoose = math.random(1,3)
13	    MapChoosenName.Value = mapChoose
14	    game:GetService("ServerStorage"):WaitForChild(MapChoosenName.Value).Parent = game:GetService("Workspace")
15	    local Character = plr.Character
 View all 44 lines...
end

wait(1) game:GetService("Workspace"):WaitForChild(MapChoosenName.Value).Parent = game:GetService("ServerStorage")

SideText.Value = " Seconds Left until the next obby!" end


this is the script I put in workspace that fires a client to show a text.

~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
local countdown = game:GetService('ReplicatedStorage'):WaitForChild('values'):WaitForChild('Countdown') 02 local SideText = game:GetService('ReplicatedStorage'):WaitForChild('values'):WaitForChild('SideText') 03 local Remote = game.ReplicatedStorage.RemoteEvents.Event 04 05 local debounce = false 06 script.Parent.Touched:Connect(function(hit) 07 if hit.Parent:FindFirstChild("Humanoid") then 08 if debounce == false then 09 debounce = true 10 end 11 local player = game.Players:GetPlayerFromCharacter(hit.Parent) 12 wait(0.1) 13 14 Remote:FireClient(player) 15 wait(0.5) 16 debounce = false 17
18 end 19 20 end)
~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~


 
````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` This is the script I put in StarterGui to show to the text when the remote event is fired.

`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
01 local countdown = game:WaitForChild('ReplicatedStorage'):WaitForChild('values'):WaitForChild('Countdown') 02 local SideText = game:WaitForChild('ReplicatedStorage'):WaitForChild('values'):WaitForChild('SideText') 04 local Remote = game.ReplicatedStorage.RemoteEvents.Event 06 05 Remote.OnClientEvent:Connect(function() 07
08 while true do 09 wait(0.1) 10 11 countdown.Changed:Connect(function() 12 script.Parent.Text = ""..countdown.Value 13 end) 14 15 end 16 end)

~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~

``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

This is the second script I put in Startergui but I didn't use FE for this.

``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````



~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
01 while true do 02 wait(0.1) 03 04
05 06
07 script.Parent.Text = 09 ""..game:GetService("ReplicatedStorage"):WaitForChild("values"):WaitForChild('SideText').Value 10
11 12 end
~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~



 
```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

that's Basically all.. all these scripts work in roblox studio and not in an actual server. I've also noticed that when I join team test it does not work and the 3 scripts, the one in workspace and the 2 in starterGui go fully blank and turn to

I got no idea why that is happening.. Any help?

6 comments

0

I think team collaboration or something makes it do that. I saw something similar a while back while reading the questions page. I'll look into it alittle more and try and find an answer.

0

I will tell you one thing though, organizing your code so that everything can be viewed without scrolling right is common practice when dealing with any programming language. I highly suggest you do this, instead of 1 lining everything, if it wasn't just the way it showed here.

0

I think it was just bugging out right now, because I see the line numbers. That's odd lol

0

Oh sorry, it was just the way it posted here..

0

You might restart studio, I know there is a bug where it just stops giving errors and stops running the things you've changed.

0

I wish I was more knowledgeable on this. Hope someone answers so I can learn something. You should try the discord.

1 answer

Well, you didn't save the scripts probably. In team create, there's an issue saving scripts, but I'm here to help about it, even though you've published something that does not mean it published all, if you're in team create. Here's how to fix it :

**

  1. Go to view.
  2. Go to drafts.
  3. Choose your scripts.
  4. Right click in mouse.
  5. Press "Commit".
  6. Do it to other scripts.
  7. Publish, the error will still appear but it will be published. **

That's how you fix this, was happy to help.

This discussion is preserved as it was. New answers, comments, and votes are closed.