Forum > Coding >

How to make input that can be inputed as a script.

JamAdventurer

JamStudios Corporation

Posts: 13

Threads: 6

Joined: Mar, 2022

Reputation: 0

Posted

How to make input that can be inputed as a script, because i was making a PlayerMusic Script, But it din't work, I wonder if there is any other way of making it output like this and for it to be executed as a lua script in WRD API. 

rbxassetid://01234567
Instance.new('Sound', script)
sound = script.Sound
sound:Play()
wait(sound.TimeLength)
end

This is the Code that I use in C# that din't work.

using System;
using System.Windows.Forms;
using WeAreDevs_API;

namespace DynamicClient.GameClient.Extras
{
    public partial class PlayerMusic : Form
    {
        readonly ExploitAPI api = new ExploitAPI();
        public PlayerMusic()
        {
            InitializeComponent();
        }
        private void label3_Click(object sender, EventArgs e)
        {
            string MusicID = "sound.SoundId = rbxassetid://" + (MusicInput.Text);
            string ScriptLine1 = "Instance.new('Sound', script)";
            string ScriptLine2 = "sound = script.Sound";
            string ScriptLine3 = "sound:Play()";
            string ScriptLine4 = "wait(sound.TimeLength)";
            string ScriptLine5 = "end";

            api.SendLuaScript(ScriptLine1 + Environment.NewLine + ScriptLine2 + Environment.NewLine + MusicID + Environme
        }
  • 0

An Official Account:- Jam

Posts: 793

Threads: 54

Joined: Sep, 2021

Reputation: 21

Replied

uhh you can just use 

string script = @"
print('yes')
print('sir')
"
  • 1

Added

@_realnickk srry, i fixed it

  • 1

dead inside

JamAdventurer

JamStudios Corporation

Posts: 13

Threads: 6

Joined: Mar, 2022

Reputation: 0

Replied

Wait.. what about inputing the string into another string? like how do I make the Input [MusicInput.Text] into the lua code while still making it have sentences, so it can be outputed correctly.

  • 0

An Official Account:- Jam

Kura

kuraise

Posts: 135

Threads: 3

Joined: Jun, 2021

Reputation: 5

Replied

The lua code is the problem.

local Music = Instance.new('Sound', 'Name')
Music.Parent = game.SoundService
Music.SoundId = "rbxassetid://01234567"
Music:Play()
  • 0

 

https://cdn.discordapp.com/attachments/877610317037858846/975469974405673041/Signature.png

JamAdventurer

JamStudios Corporation

Posts: 13

Threads: 6

Joined: Mar, 2022

Reputation: 0

Replied

The [MusicInput.Text] contains the roblox asset id, when the user input's the asset id in the TextBox it's string is [MusicInput.Text] in C#, and I need to somehow put [MusicInput.Text] (Asset Id from the Textbox in C#) in the lua code.

  • 0

An Official Account:- Jam

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )