Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is my script causing prevent me to test out my games in studio?

Asked by 5 years ago

Every time I wanted to test out my game it simply just stops at 33%, i'm not sure if its my scripts causing the studio to bugging out.

Script1_BanService


--start of script local sservice = game.ServerScriptService if script.Parent ~= sservice then script.Parent = game.ServerScriptService end --wait() can screw banservice check local Bstat = game:GetService("DataStoreService"):GetDataStore("BanService_1") local Wstat = game:GetService("DataStoreService"):GetDataStore("BanService_1") local Rstat = game:GetService("DataStoreService"):GetDataStore("BanService_1") --create ui message when ban/warning is true --[[ local ReasonMessageValue = Instance.new("StringValue")--finish this man local storedDatas = Instance.new("Folder") storedDatas.Parent = game.ServerScriptService ReasonMessageValue.Parent = storedDatas ReasonMessageValue.Value = "nil" ReasonMessageValue.Name = "Value" ]]-- Waste of time, idea discarded --function sendval() --end --function sendtoui() --end game.Players.PlayerAdded:connect(function(player) local Banned = "user_" ..player.userId local Warning,Reason = "user_" ..player.userId if Bstat:GetAsync(Banned) == 1 then ReasonMessageValue.Text = ReasonMessageValue kick() end end)
0
What do you mean by, "It stops at 33%"? Nothing here seems like it would cause issues with your game itself or conflict with it in any way - and even if it did you could just pcall it. SummerEquinox 643 — 5y
0
You will get an error: 'ReasonMessageValue a nil value' because you commented the variable that defines it. You will also get a error for kick() because there are no functions named 'kick'. You can kick a player like this: player:Kick("reason in string"). Make sure you have autosave enabled so when it freezes you can restart studio and open the auto saved file. hellmatic 1523 — 5y

3 answers

Log in to vote
0
Answered by 5 years ago

I had something similar happen to me. My problem was that i didn't have wait() in the script, and this apparently made the studio freeze when i tried to test.

while true do
    --wait() was missing
    --some other codes
end

Maby try this:

if script.Parent ~= sservice then 
    wait() --try to add this and see if that helps
    script.Parent = game.ServerScriptService
end
0
Where do you see a while true do loop in his script, Please? AswormeDorijan111 531 — 5y
0
@Asworme, there is no call for this level of toxicity - he is clearly trying to help, so treat him with civility. SummerEquinox 643 — 5y
0
It's fine. I don't tend to take things to heavily. I just suggested the use of wait() because i got a similar problem with testing a while ago because of the absence of wait() in one of my scripts. GlennJoakim 35 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Alright, first of all, userId is deprecated, use UserId instead, also you should be using Connect instead of connect.

~~~~~~~~~~~~~~~~~ --start of script

local sservice = game.ServerScriptService

if script.Parent ~= sservice then script.Parent = game.ServerScriptService end

--wait() can screw banservice check

local Bstat = game:GetService("DataStoreService"):GetDataStore("BanService_1") local Wstat = game:GetService("DataStoreService"):GetDataStore("BanService_1") local Rstat = game:GetService("DataStoreService"):GetDataStore("BanService_1")

--create ui message when ban/warning is true

--[[ local ReasonMessageValue = Instance.new("StringValue")--finish this man local storedDatas = Instance.new("Folder") storedDatas.Parent = game.ServerScriptService ReasonMessageValue.Parent = storedDatas ReasonMessageValue.Value = "nil" ReasonMessageValue.Name = "Value" ]]-- Waste of time, idea discarded

--function sendval() --end

--function sendtoui() --end

game.Players.PlayerAdded:Connect(function(player) local Banned = "user_" ..player.UserId local Warning,Reason = "user_" ..player.UserId pcall(function() if Bstat:GetAsync(Banned) == 1 then ReasonMessageValue.Text = ReasonMessageValue kick() end) end end) ~~~~~~~~~~~~~~~~

0
Retarded lua block wont show up the script... AswormeDorijan111 531 — 5y
0
DEPRECATION ~= BUG 95% of the time. The fact that these calls are deprecated is not the issue with his script. SummerEquinox 643 — 5y
Log in to vote
0
Answered by 5 years ago

Still stuck at 33%. I've rewritten the script with no errors and bugs and my studio stops at 33% when testing

Answer this question