Wouldn’t the CustomGui be in PlayerGui instead of StarterGui when the player is in game?
I tried that but it only works for starter gui when players write on the part that’s adorned by the CustonGui well idk. I just wanna know how to do the name after they wrote the id on the part…
O wait lemme try using PlayerGui again
Yeah its not working, idk why
I did like
Idk whats the problem, I’m literally an idiot lol
There are many things wrong with your script,
First of all, this script has to be a LocalScript, if you are not using one already.
Second of all, Line 1 & 2, you are setting ‘name’ to the ‘TextBox’ text, but then immediately settings ‘name’ to nothing on line 2.
Third of all, you don’t play a sound by setting ‘Playing’ equal to true, you do ‘[your sound location]:Play()’.
Forth of all, after the new audio update, you can’t make radio systems to play songs the developer does not own.
So if you are trying to make a radio system, then its impossible, sorry, but here is your fixed script, if it helps:
local _playersService = game:GetService("Players")
local _player = _playersService.LocalPlayer
local _name = game.Players.Name.CustomGui.TextBox.Text
workspace.[Your part].Touched:connect(function(hit)
if (hit.Parent = _player.Character) then
[location to your audio].SoundId = "rbxassetid://" .. _name
[location to your audio]:Play()
end
end)
Oooo ok, sorry for being an idiot, Im learning how to code while im reading the roblox code book
Whoops, my bad, add an extra ‘=’ following my ‘=’ in the ‘if statement’.
Put the script in PlayerGui, make sure the script is a LocalScript. You have to make sure you are allowed to use the audio ID you are trying to play first.
this one?
Yes, the same way you add a script, add a LocalScript.
is it not working? Im using the audio made by roblox
You aren’t defining the audio clip in the LocalScript, do ‘workspace.Audio’ or something.
Give me a quick moment. Ill write you something
wdym arent defining the audio clip in localscript?
local audio = workspace.Part.Audio
In your script you are saying
local audio = script.Parent.Audio
But your audio isn’t a child of PlayerGui.
Wow tytyty! First ima read it and understand it but thank you! btw I gave you 20 robux from Donate me. I wish I could give you more than that ;w;