Hi,
I am probably a lot less experienced than a beginner when it comes to scripting, so this might seem simple to a lot of people. I would like to know how to create a button that, once made contact with one player's character (not clicked, but touched), changes the whole server's music and resets all players. Then after 30 seconds, resets the music to its original music.
I don't even know how to begin writing this script, but would be very nice of you to give me a hand. I would also need to know where the script should go and what properties need to be changed if any. (I know where each category in Explorer is, but don't know which one/s I'll need to put the script in to create this)
Many thanks!
It is against the scripting helpers rules to ask for us to create a script for you, but I can point you in the right direction to find your feet in scripting. Try checking the Roblox wiki here if you are unsure in the future. These links may help you:
And you may also want to look at these guides:
Here is how you would do server music:
s = Instance.new("Sound") s.Parent = game.Workspace s.SoundId = "rbxassetid://000000000" -- Sound ID goes here s.Volume = 1 s.IsPlaying = true s.Looped = true
How to change it:
Assets = {00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000} part = script.Parent bool = true function onTouch() bool = false if part:FindFirstChild(¨Humanoid¨) ~= nil then for _, asset in ipairs(Assets) do Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..asset) end wait(2) bool = true end part.Touched:Connect(onTouch)
As for killing the player:
part = script.Parent player = game.Players:GetPlayerFromCharacter(part) function onTouch() if player ~= nil then player.Humanoid.Health = 0 end end part.Touched:connect(onTouch)
There you go.
ok i know how to add the "click button to change music script" but thats all first add your music to the game..add a sound..and edit the sound id so you have your own music. then add a script to the button ..this is the button that you want them to click to change the music
script.Parent.MouseButton1Click:connect(function(plr) game.Workspace.Sound:Play() wait(30) plr:kill--this line might not work end)
so this says when u click the button the sound plays..and it might kill player after 30 seconds.Hope i can help..Also...
Please dont send negative reviews on my awnser because im in the negatives and im trying to get back to 0...The reason why i dont ask questions is because people send negative reviews and puts me far in the negatives...im close to being back at 0 and i dont want spoilers ruining this..and if you can accept my awner :D