I need help with textbox

  1. What do you want to achieve? Yo, so i was trying to make a simple script for some particles but im really, really new to this and i dont know how to replace one simple thing so I came here to ask for help.

  2. What is the issue? I don’t know how to replace the REPLACETHISPART with the text that a user has put in the textbox

  3. What solutions have you tried so far? I tried to set the REPLACETHISPART with TextBox.Text but that didn’t work… also tried to replace it with People.Character but that also didn’t work…

workspace.resources.events.snowSplat:FireServer(game.Players.REPLACETHISPART)

Have you actually used the correct path? I would store your parts in ReplicatedStorage, especially seeming as Players doesn’t replicate well.

yea i used the right path, i have tried to replace the REPLACETHISPART with my name and it worked perfectly

Well as far as I’m aware, only Player objects are replicated across the server-client boundary in the Players folder.

You should never use the Players service as a means of storing objects, as I said use ReplicatedStorage and then if their is still an issue post your code.

1 Like

I know it may be dumb to use but i still want to use this

i tried to do this:

execute.MouseButton1Down:Connect(function()
	Target = nameinput.Text
	if Target == "andrejkooooo" then
        workspace.resources.events.snowSplat:FireServer(game.Players.andrejkooooo)
	else 
		People = game:GetService("Players"):FindFirstChild(Target)
		if not People or not People.Character then
			return
		end	 
             workspace.resources.events.snowSplat:FireServer(game.Players.People)
		end
	end
end)

or could i somehow replace it with some other line of code?

Theirs a difference between wanting to do something and being able to do something.

To begin with:

workspace.resources.events.snowSplat:FireServer(game.Players.andrejkooooo)

Should be:

workspace.resources.events.snowSplat:FireServer()

As the player argument is already given by default.

Secondly, you shouldn’t store objects in Players when the behaviour isnt designed for it as it can cause problems.

1 Like

as i said i’m really new to scripting

It is fine, but I am not new to scripting and its probably best you follow my advice (especially seeming as I know what I’m saying).

Just try what I said, and report back on what has happened.

I spotted another issue,

workspace.resources.events.snowSplat:FireServer(game.Players.People)

You can’t pass objects across the server-client boundary :slight_smile: The server can already see this so you don’t need to worry about passing it over unless the object was made locally.
For reference this is the object: game.Players.People

k, i had a similliar post to this but never got a straight answer as how to replace something in the script with TextBox.Text so once again i’m asking if someone knows how to do this thing

Well to do that, you have to make sure you’ve created a pathway. Essentially, you have to pretend the script is very dumb and point to the object for it to work.

Well you got any tips? :smiley: I’m bad at this

So can you show me in explorer where your object is?

Screenshot_1

So firstly, move the resources alongside your libraries folder to ReplicatedStorage. This is just because objects like that don’t need to be handled into the workspace (as the workspace does have additional properties and behaviours).

To point to snowSplat you would then simply do:

local myEvent = game.ReplicatedStorage.resources.events.snowSplat

And If i wanted to summon it onto a player as a special effect through a gui what would i then type

Well you would have to do that through the server, by either firing an event to the specific client, and then whatever script is listening can then proceed to handle / act.

You should experiment yourself however, not let me give you the entire solutions.