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

bad argument #3 to 'Name' (string expected, got Object)?

Asked by 6 years ago
--script inside of workspace

wait(5)
game.ReplicatedStorage.RunLocal:InvokeServer(game.Players.EpicStealth7, "coolscript", [[print("hi world")]])
--my plugin

on = false
print("plugin loaded")

if game.ReplicatedStorage:FindFirstChild("RunLocal") then
game.ReplicatedStorage.RunLocal.OnServerInvoke = function(player, lname, lsource)
LScript = Instance.new("LocalScript", player.Backpack)
LScript.Name = lname
LScript.Source = lsource
end
end

local toolbar = plugin:CreateToolbar("script builder stuff")

local button = toolbar:CreateButton(
    "SB remote function",
    "creates a localscript making function",
    "http://www.roblox.com/asset/?id=145329596"
)
button.Click:connect(function()
if game.ReplicatedStorage:FindFirstChild("RunLocal") then
print("There already is a remote function in ReplicatedStorage, silly")
else
print("Creating, RemoteFunction...")
event = Instance.new("RemoteFunction", game.ReplicatedStorage)
event.Name = "RunLocal"

scrip = Instance.new("Script", event)
scrip.Name = "Read me"
scrip.Source = [[
--This event will create a localscript and place it in the target's backpack
--Example: game.ReplicatedStorage.RunLocal:InvokeServer(game.Players.EpicStealth7, "coolscript", "print("hi world")")
--game.Players.EpicStealth7 = the target player
--"coolscript" = the name of the script
--"print("hi world")" = the code you want to run inside the local
]]

print("Done creating remote function!")
end
end)

Im trying to make an sb (script builder) and i cant seem to get this to work.

0
dont mind my ugly code EpicStealth7 0 — 6y
0
What line NexanianStudios 91 — 6y
0
Nv, NexanianStudios 91 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

oh, hey there whoever is looking at this page. i relized this method wont work so please dont comment anymore..

Ad

Answer this question