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

my scripts arent detecting replicated storage children?

so im making an easter egg in game and im trying to make a text label that changes but only for the player who touched a part. so now im trying to use a remote event to change it and i think it would work perfectly but i get this error: 15:42:56.245 - RemoteEvents is not a valid member of ReplicatedStorage and i can clearly see it is there. No miss types, no capitalization errors. here is the script maybe i did something wrong that i dont know about, im a beginner and im new to remote events, i started learning how to use them like half a hour ago.

this is the local script for remote event:

local service = game:GetService("ReplicatedStorage")
local events = service.RemoteEvents
local greendirt = events.greendirt
greendirt.OnClientEvent:Connect(function()
	local text = game.StarterGui.TFlaniganDialogue.d1
	local text1 = "..."
	local text2 = "why would someone like this come here?"
	local text3 = "hmm?"
	local text4 = "i guess you dont like to talk."
	local text5 = "... or you are a bit shocked?"
	local text6 = "you probably got here by accident... just like i did..."
	local text7 = "well, i didn't see a single human for years!"
	local text8 = "i'll reward you with the ability to spawn the green dirt."
	local text9 = "bye!"
	local text = game.StarterGui.TFlaniganDialogue.d1
	wait(1)
	for i = 1, #text1 do
	    text.Text = string.sub(text1, 1, i)
	    wait(0.04) 
	end
	wait(3)
	for i = 1, #text2 do
	    text.Text = string.sub(text2, 1, i)
	    wait(0.04) 
	end
	wait(4)
	for i = 1, #text3 do
	    text.Text = string.sub(text3, 1, i)
	    wait(0.04) 
	end
	wait(3)
	for i = 1, #text4 do
	    text.Text = string.sub(text4, 1, i)
	    wait(0.04) 
	end
	wait(4)
	for i = 1, #text5 do
	    text.Text = string.sub(text5, 1, i)
	    wait(0.04) 
	end
	wait(3)
	for i = 1, #text6 do
	    text.Text = string.sub(text6, 1, i)
	    wait(0.04) 
	end
	wait(3)
	for i = 1, #text7 do
	    text.Text = string.sub(text7, 1, i)
	    wait(0.04) 
	end
	wait(3)
	for i = 1, #text8 do
	    text.Text = string.sub(text8, 1, i)
	    wait(0.04) 
	end
	wait(4)
	for i = 1, #text9 do
	    text.Text = string.sub(text9, 1, i)
	    wait(0.04) 
	end
end)

and here is the one that activates it on touch:

local part = script.Parent
local service = game:GetService("ReplicatedStorage")
local events = service.RemoteEvents
local greendirt = events.greendirt
part.Touched:Connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if hum then
        local plr = game.Players:FindFirstChild(hum.Parent.Name)
        if plr.GreenDirt.Value == false then
            hum.WalkSpeed = 0
            hum.JumpPower = 0
			greendirt:FireClient(plr)
        end
    end
end)

i would appreciate any help.

3 comments

0

ReplicatedStorage dumps it’s children somewhere I believe, Workspace possibly?

0

No apparently not

0

Try using Instance/Instance:WaitForChild("RemoteEvents")

1 answer

✓ Accepted answer

This may or may not feel as an explanation but it is the most likely possibility if we are to trust that you are 100% correct in saying that all the capitalisation is correct. It is likely that you are trying to access the "RemoteEvents" folder (I presume) before the game has time to load it in. It may also have something to do with the "game:GetService("ReplicatedStorage")" but that's a me thing. I suggest putting;

local events = service:WaitForChild("RemoteEvents")

This will make it so that the compiler will wait for the "RemoteEvents" object to be loaded in, even if it isn't there. I suggest putting more ':WaitForChild()' functions around your objects inside of RemoteEvents.

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