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

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

--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.

3 comments

0

dont mind my ugly code

0

What line

0

Nv,

1 answer

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

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