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

[SOLVED] ca anyone help me with how to pass a value object through a remote event?

Asked by 5 years ago
Edited 5 years ago

I tried many times many way's but it isn't working? Could somone help?

It's all in a GUI but i did this quick it's not complete

Localscript:

local targetname = target.Parent.Name

script.Parent.Target:FireServer(targetname)

ServerScipt

script.Parent.Target.OnServerEvent:Connect(function(player, targetname)
    script.Parent.Username.Value = targetname
end)
0
you need to put player in the arguments of the serverscript, OnServerEvent User#23365 30 — 5y
0
and the other parameter should be after the player too User#23365 30 — 5y
0
Nope MaxDev_BE 55 — 5y
0
What is the parent of your script, local script, and event? I bet the error is either the scripts being parented incorrectly or that the Value is not a StringValue Vulkarin 581 — 5y
View all comments (10 more)
0
If u see they are good parented? MaxDev_BE 55 — 5y
0
The parent is a frame MaxDev_BE 55 — 5y
0
The parent of the script and event is a frame? Vulkarin 581 — 5y
0
Yea MaxDev_BE 55 — 5y
0
Move the event to replicated storage and move the script to serverscriptservice Vulkarin 581 — 5y
0
Okey MaxDev_BE 55 — 5y
0
Not working to MaxDev_BE 55 — 5y
0
What went wrong? You will obviously need to adjust your variables if you haven't done so already Vulkarin 581 — 5y
0
Server scripts don't run in PlayerGui in a server. They will with Play Solo though. As mentioned by Vulkarin, move the objects, and make sure the "Username" object is accessible by both script types, preferably in Workspace or ReplicatedStorage User#19524 175 — 5y
0
Bu i need a value for every player that’s a cop so that will not work when 2 players need to bebarrested MaxDev_BE 55 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

The problem is that you never defined the term target at the beginning of your script, meaning that roblox won't know what target is and return an error. Simply, just define a variable called target at the beginning of your local script and that should do the trick.

Ad

Answer this question