Hey there developers! I am making a game where you can someone obbies to practice. Now the spawning system is working, but all the scripts that are inside of the obby isn’t. Even when they work in the workspace. I have no clue why it wont work. Whats happening? Is it because its from replicated Storage?
even if they are cloned into the workspace?
Yes, Scripts and LocalScripts do not run if they’re parented to ReplicatedStorage regardless if they are cloned or not.
Where should I put it? I just tried lighting and it didnt seem to work
if you clone a script to the workspace, it will surely run the moment it gets parented to the workspace, however local scripts won’t (except if parented to starterplayer/character)
Im misunderstanding you. Do you mean that it should work if it is a cloned object of something in replicated storage?
It depends for your case. If it’s a server-side script managing the players, put it in ServerScriptService. Otherwise, if it’s a LocalScript, I would put it in StarterGui.
However, your problem here is a bit vague, so it’s sort of complicated to tell.
from what i understand u have a script in repstorage… then u clone it then u set clones parent to workspace and it doesnt work?
Indeed. Its a kill brick in an obby
scripts do not run in replicated storage, however when you clone a script and parent it somewhere where it should work, that’s basically like enabling a disabled script.
I am making an obby game, and the kill bricks in the cloned thing, arnt wokring, and its a normal script btw
so if the scripts function is to kill are u instead of putting a script in every brick u want it to loop for [Killbricks]
? like a module?
If this is the case, you could try disabling the script in ReplicatedStorage, then make the script that’s cloning the script to Workspace enable the disabled script using the Enabled property, something like this:
local s = game.ReplicatedStorage.Script:Clone()
s.Parent = workspace
s.Enabled = true
this is absolutely the same thing as cloning a pre-enabled script from replicated storage
you see, I will have multiple more obbies with kill bricks in it, so I dont think that will work, unless I am mistaken
just rq the scripts in a loop right like for
or while
i dont beilieve so, its just a kill brick that kills you once you touch it
it has to be constantly checking for the player to touch it otherwise it runs once and then never checks again
if you’re just trying to have a script that kills someone everytime he touches a kill brick i suggest you use one script that handles every brick with the help of CollectionService