I have been trying to make it so you type a player into a textbox and then tp to them but my issue is that it thinks the person in the textbox is the player inputting it.
I am connecting a localscript to a script and transferring (player, script.parent.text)
I have looked at these:
The first one almost worked but as you saw above it had that problem.
This was my localscript:
local r = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("RSpecial"):WaitForChild("TattooYouGUI")
script.Parent.FocusLost:Connect(function()
local findplayer = game.Workspace:FindFirstChild(script.Parent.Text)
local player = game.Players.LocalPlayer
local character = player.Character
if not findplayer then return end
if findplayer:FindFirstChild("Stand") then
if findplayer.Stand.Value == "Tattoo You" then
print("ok!")
r:FireServer(player, script.Parent.Text)
else
print("non :rage:")
end
end
end)
This was my serverscript
local r = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("RSpecial"):WaitForChild("TattooYouGUI")
r.OnServerEvent:Connect(function(player, Text)
if player.Name ~= script.Parent.Parent.Name then return end
local gui = player.PlayerGui.RSpecialsRequiringGUI.TattooYou.Frame
local findplayer = game.Workspace:FindFirstChild(tostring(Text))
print(findplayer)
local character = player.Character
task.wait(1)
character:SetPrimaryPartCFrame(findplayer.PrimaryPart.CFrame * CFrame.new(0, 0, -1))
end)
What he’s saying is that, by default, when a localscript runs FireServer() on a RemoteEvent, the first value received on the OnServerEvent is the LocalPlayer instance.
So when you fire
r:FireServer(player, script.Parent.Text)
the server is receiving
(player, player, script.Parent.Text)
meaning that what the server receives is two of the same instance for both “player” and “Text”