Local scripting not running?

Text button, checked it about 5 times, lol

Can you check to see if it’s “selectable”?

It is check to true, https://gyazo.com/56db5f2dd2ac30fe54c767e57b049cdd

I am honestly stumped by this, I think the problem is coming from the

For some reason I can’t select it when I was in game. I wish I could help but this is beyond me.

Have you tried adding a :WaitForChild() on the event in replicated storage?

EDIT: What specifically is wrong? Is it not printing ‘Loaded’?

(I’m not 12904) If you go into the game, and open the Dev Console, it doesn’t appear to print “Loaded”.

If there are any other errors, that’d be helpful. I think it’s the error in detecting the Replicated Storage event.

Disabled scripts are grey now, ROBLOX changed this a while ago. (Sorry if I’m being rude. :slight_smile:)
Edit: Proof is in the first gyazo link.

1 Like

Well, I personally think that there are some very obvious issues here and bad practices being screamed out. Aside from those, it looks like the error is more of another script over this one.

This here is why disabling Accurate Play Solo is discouraged, to avoid “it works in Studio but not in-game”. Something working in Studio doesn’t mean it’ll do the same in-game.

Now code:

  • Wait at the top of your script, which is bad practice. If you’re trying to wait for things to load, use proper methodology to yield the execution for those items.
  • Lack of use of WaitForChild - instances are not implicitly loaded.
  • Random local variables - can you not just put these into a table?
  • Why not just handle this differently instead of firing a massive string off? You can concatenate the answers submitted on the server later.
-- Roblox services first
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- Objects next
local Event = ReplicatedStorage:WaitForChild("Event")

local Questions = {
    -- Why not just put these in a ModuleScript in ReplicatedStorage so both the server and client can fetch them?
    [1] = "Why do you think you deserve this position(Please supply 3+ sentences)",
    -- ...
}

-- I prefer putting LocalScripts to control Guis in the LayerCollector, not in the GuiButton object...
script.Parent.MouseButton1Down:Connect(function ()
    -- Send answers - no need to send questions. See previous comment in Questions table.
    Event:FireServer({--[[fill this table with your answer strings]]})
end)
1 Like

I have already tried Wait for child and it did not change a thing, As with the current code, I wrote them in a way that the future owner(I am making this for a group) can understand as he is a newer scripter, this way he can edit it in the future if needed. Which this way works, it may not be as efficent, but it will be enough for the future owner to understand easier, As with the script.Parent.MouseButton1Down, I have tried it as well, I have tried 1Down and 1Click, neither one seems to work.

That wouldn’t work if the script aint running to begin with would it? I am getting litterally nothing in the Dev Console, meaning it is not printing, or giving any errors.

@snorebear Yes I have tried it, it just doesnt do anything, the function does not trigger, and it does not print the “Loaded” or “Fired”

@xBeepBoop No sadly, it doesn’t, it was one of the first things I checked.

You shouldn’t teach them bad practice.

Find it impossible to believe this because that’s not possible. The full object hierarchy isn’t provided in screenshot 1 and there’s nothing wrong with the code. LocalScripts are also not broken. It’s a problem with the way you’ve set up your code or another script is having an impact on this.

Well, I know this, I have no other scripts inside messing with this one, I have nothing that should be influencing it that I have not already posted. If it made sense, I wouldn’t of posted it here. Either way, this script is not running for some reason, I have since tried to just put it in a different script and replacing it, also added another print before I get the remote event to make sure it wasn’t breaking there, It still was not printing.

Could this be a problem with the game system, as this game was made before FE was popular so it was not set to it, I just recently converted it to FE and trying to get it to work now, between these conversions is where it broke sadly.

If it was being influenced by another script making it stop, its either a virus inside of the game or a glitch in the roblox Engine, I will run ro-defender through it and see if it catches anything even though the only FM I have ever put in was the Old discord webhook manager, (Now using Osyris’s proxy).

And personally, I think it is better to have a script you can understand, then a script that is flawless in every way, because either way, its going to do the same job and do it with the same accuracy.

You still haven’t posted either a complete hierarchy or the whole script, so it’s hard to determine what your issue is. I can’t help you if you can’t help me. This code is fine, so there is very clearly something else that is affecting the thread’s execution, whether that’s something that you’re not posting or something that’s coming from another script.

No. LuaSourceContainers don’t just up and break and never have. It’s your implementation.

You never know. That could be the very problem that you have to work with. Your code barely looks maintainable or readable as it is, ignoring everything else that I’ve already mentioned about it.

https://gyazo.com/88cbb8958f661bfaed25e6bacfe0dc76

The only local script in the game as well. There is only 1 other script and it is in ServerScriptService and it receives the information from this one,

https://gyazo.com/be8ed94f4199e1b4018efae020114c6f

-- Made by 12904(Builder/Scripter)

local url = "http://discord.osyr.is/api/webhooks/569189207222910986/xuXMSl72U3ti-re3J47uXCtazRrPHbpQy2I8N-l0YAza4YBa98YdHQTWP0xmcro-dqTH"

local Event = game.ReplicatedStorage:WaitForChild("Event")
local HttpService = game:GetService("HttpService")

function send(Name, message, plr)
	HttpService:PostAsync(url, HttpService:JSONEncode({avatar_url = "", username = Name, content = message}))
end

Event.OnServerEvent:Connect(function(plr, message)
	print("Fired")
	send("Application Bot", message, plr)
	print(message)
	for i,v in pairs(game.Players:GetPlayers()) do
		v:Kick("Thank you for summiting a application, your application will be read immedately.")
	end
end)

As with with you think about the code, I do agree to an extent, the current code is not perfect, but its simple, and Id rather it be easy to read then the most efficient, after all, these are 1 player servers that will receive very little traffic, and the script being less then 30 lines will not have any effect on it.
But as you said about it not being reader, I am a bias opinion of course because I wrote it so its easier for me to understand then other people, but basically all it is doing it concatenating a multi line string then sending it through a remote event, that is literally all it is.

If it is, I do not know where it would be, this is the same system that I have used for hundreds of scripts and it has never failed until now, The functions, variables, etc are all the same.

Above I have scripts of the Hierarchy of all the scripts and the code to the ServerSide

I have no clue what the issue is. I just made a quick repro of this in Roblox Studio and it works as intended. There’s an underlying problem that’s not being seen.

image

LocalScript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("Event")

print("Loaded")

script.Parent.MouseButton1Click:Connect(function ()
	Event:FireServer("Send")
	print("Sent", "Client")
end)

Script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("Event")

Event.OnServerEvent:Connect(function (Client, ...)
	print("Received:", Client, "-", unpack({...}))
end)

Output:
image

Repro file:
12904_Problem_Repro.rbxl (18.4 KB)

Perhaps you’d be willing to send a barebones file of your implementation to be picked at in Roblox Studio to attempt to find a solution? It seems that screenshots clearly aren’t enough.

Alright, no problem, sadly I gtg rn Ill be back in around a hour, the file is below, excuse the cringy guis…

RobloxApplicationPlaceError.rbxl (21.3 KB)

1 Like

I removed the wait(.1) in the local script and it automatically worked. :slight_smile:
Though, still not sure why the problem was happening though.

Edit: The repro file had no problems in it.

1 Like

There’s absolutely no problem with this code. It ran just fine in both Roblox Studio and a production environment and I didn’t touch a single thing. You sure this code is bugged, or you didn’t check your place settings, or something?

What issue do you have when you have this uploaded? Worked as intended for me.

Studio output:
image

In-game output, client-side:
image
(couldn’t screenshot after submitting because it kicked me and the overlay blur gets in the way - I didn’t remove the kick statement)

By the way, you’re going to want to change your webhook later, for security purposes.

1 Like

I have no idea then, let me put it in a different game and try it, (Also about the webhook, Ik, it made a server Im going to delete prob tonight to get this working, then I will implement it into the regular server)

Back early btw

Whelp, Im a idiot, I just realized why nothing I was doing was working, each time I was saving to try it in-game, I was closing studio and pressing publish as I leave. For me its been a glitch where it doesn’t publish to the game for some reason, so if I go through File>Save to Roblox As and then select the correct file, then it will save. This completely slipped my mind, but as I said in my first message,

Thank you everyone for all of the help!

7 Likes