Hello i am making admin commands, i want to make sound script but it isnt working can i get an help please? Thanks!
function commandTable.sound(message, player) local sarki = Instance.new("Sound") sarki.Parent = game.Workspace wait(0.1) sarki.SoundId = "rbxassetid://" ..player print("Sarki oynatiliyor") end
The feature "rbxassetid" is meant for:
-Sound IDs
-Decals
-Meshes
But not players. If you want to detect a player's ID, use "http://www.roblox.com/users/" and then the player's ID.
Using "rbxassetid://"
The feature itself can do many things. For starters, applying a Sound ID to "rbxassetid://" would support a Sound Instance with a Sound ID from which it can play.
Applying a Decal ID to "rbxassetid://" will display a certain decal as long as the script is a child of the Decal.
Applying a Mesh ID to "rbxassetid://" will supply a Part with a mesh to make it look like something else.
To exactly use "rbxassetid://", you could do (for audio):
s = Instance.new("Sound") s.SoundId = "rbxassetid://000000000" -- ID goes here
For decals:
d = Instance.new("Decal") d.Parent = script.Parent -- Script's Parent is a Part d.Texture = "rbxassetid://000000000" -- ID goes here
For meshes:
m = Instance.new("MeshPart") m.Parent = script.Parent -- Script's Parent is a Part m.MeshId = "rbxassetid://000000000" -- ID goes here
That's what you need to know.