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

Why won't my server scripts work in the serverscriptservice???

Asked by 6 years ago
Edited 6 years ago

I've been trying to call a remote event, from a tool, through the replicated storage(where the remote event lives) to a script in serverscriptservice, and while it works fine in solo mode, playing in test, and ingame, it wont work! Why is this? I discovered while playing in test some scripts are appearing in serverscriptservice, and others are not, particularly the one i'm trying to call. However, whilst looking through the server window, in test mode, the scripts are in the Scerverscriptservice. I know the answer is staring me straight in the face. Can anyone help?

01-- localscript in tool
02 
03local wand = script.Parent
04 
05local ArchFolder = wand:WaitForChild("Effects")
06local person = wand.Parent
07local inc = script.Name
08local owner, connect
09local Power = wand.Power.Value
10 
11 
12 
13 
14 
15function Setup()
View all 48 lines...

the remote function exists in the replicated storage

001-- script in serverscriptservice
002 
003 
004 
005local Casting = game.ReplicatedStorage.Remotes:WaitForChild(script.Name)
006 
007 
008print("seeing if this stupid thing is working")
009 
010 
011 
012 
013 
014function CastSpell(Player, wand)
015 
View all 180 lines...
0
you should try debugging. Make a call to the print function for every function, if, etc, to check if it's actually running. It could be that it's Disabled or something. User#19524 175 — 6y
0
And please post your scripts, how will you be helped without it, we can't read your mind. User#19524 175 — 6y
0
added the scripts, sorry bout that! Manelin 2 — 6y
0
there are lots of print functions so i can see what works and what doesnt. Bascially in solo mode it does the whole thing, but in test mode or ingame mode, it stops at the end of the local script. Manelin 2 — 6y
View all comments (2 more)
0
Is this your script? User#19524 175 — 6y
0
the talky part, to call when the player talks is not mine, but everything else is. only the part to index when the player says the script.name. and that part works ingame. Manelin 2 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Your script will work fine in ServerScriptService. If something is not working, there is an issue in your code. You can prove that ServerScriptService will work by adding another script and placing a print() inside.

Check for any errors. If there are no errors, something in the script has possibly made a silent error causing the script to stop without error. When I get frustrated with this stuff, I add a print() after everything to find when it stops printing.

0
The problem im having, is that i thought it might be part of the script. but the only issue is occuring when its trying to call the event. In play solo, it works fine, but ingame it wont, i check the output in the developer window ingame, and it follows all the prints through the localscript, including after it fires the server, the problem is its not indexing the server script. Manelin 2 — 6y
Ad

Answer this question