|
| 31 Oct 2016 10:42 AM |
1) I have no idea what I do when it comes to scripting 2) I really need this script lol - so I need a script to where I type !victory and it will put up a decal on the middle of the screen and play a music file that I want. How do I do that? Thanks -Irish ps . talk dumb to me I don't know too much. - so pretty much when someone wins I can do !victory and it will pop up a "Victory" decal and play some orchestra. Thanks again. |
|
|
| Report Abuse |
|
|
sparker22
|
  |
| Joined: 11 Mar 2010 |
| Total Posts: 846 |
|
|
| 31 Oct 2016 10:45 AM |
Hook into the chatted event.
You can then get the messages a player types. Look into string manipulation to find the pattern for !victory and then execute whatever after that.
http://wiki.roblox.com/index.php?title=Global_namespace/String_manipulation http://wiki.roblox.com/index.php?title=API:Class/Player/Chatted |
|
|
| Report Abuse |
|
|
|
| 31 Oct 2016 10:52 AM |
my brain just killed itself, ehm. what? |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
| |
|
sparker22
|
  |
| Joined: 11 Mar 2010 |
| Total Posts: 846 |
|
|
| 31 Oct 2016 11:04 AM |
The chatted event lets you grab the messages that is typed from the player you attach it too.
String manipulation is taking a string (just text in simple terms) and using built in functions to find patterns or certain groups of text inside of it. (If you're looking for just !victory you can probably skip it entirely and just check if the string itself is equal to the text) |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 11:13 AM |
id = 1234567 -- replace with your decal ID game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if player.Name == "IrishBanana" then if msg == "!victory" then for _,player in pairs(game.Players:GetPlayers()) do local gui = Instance.new("ScreenGui",player.PlayerGui) local frame = Instance.new("Frame",gui) frame.BackgroundTransparency = 1 frame.Size = UDim2.new(0,400,0,400) frame.Position = UDim2.new(.5,0,.5,0) local image = Instance.new("ImageLabel",frame) image.BackgroundTransparency = 1 image.Image = "rbxassetid://"..id image.Size = UDim2.new(1,0,1,0) end end end)
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 11:14 AM |
game:GetService("Debris"):AddItem(gui,7) -- removes the Gui after 7 seconds, put just before the ends if you want it.
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 11:17 AM |
Oh and you wanted it to play the music, for that, you can say something like this after the Debris line
track = 1234567 sound = Instance.new("Sound",workspace) sound.SoundId = "rbxassetId://"..track sound.Volume = 1 repeat wait() until sound.TimeLength >0 sound:Play() wait(10) -- how long you want it to play for i = 1, 100 do sound.Volume = 1-(i/100) end sound:Destroy()
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 11:18 AM |
Oops! This,
for i = 1, 100 do sound.Volume = 1-(i/100) end
Should be this
for i = 1, 100 do sound.Volume = 1-(i/100) wait() end
Otherwise there would be no fade :)
|
|
|
| Report Abuse |
|
|
MiniNob
|
  |
| Joined: 14 May 2013 |
| Total Posts: 822 |
|
| |
|
|
| 31 Oct 2016 05:12 PM |
| I put it all together correctly, when I used in testing I used "Player1" and it did not work. ## # #### it in-game after I selected active. "IrishBannana" when I typed "!victory","!Victory" they both did not work. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 05:47 PM |
I misspelled your username you can say something like,
if player.Name == "IrishBannana" or player.Name == "Player1"
|
|
|
| Report Abuse |
|
|
|
| 31 Oct 2016 07:25 PM |
| I know, my name was taken. but I did put it all in correctly. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 07:27 PM |
Can you post the code you're using?
|
|
|
| Report Abuse |
|
|
|
| 31 Oct 2016 08:14 PM |
id = 300374048 -- replace with your decal ID game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if player.Name == "IrishBannana end" end" then if msg == "!victory" then for _,player in pairs(game.Players:GetPlayers()) do local gui = Instance.new("ScreenGui",player.PlayerGui) local frame = Instance.new("Frame",gui) frame.BackgroundTransparency = 1 frame.Size = UDim2.new(0,400,0,400) frame.Position = UDim2.new(.5,0,.5,0) local image = Instance.new("ImageLabel",frame) image.BackgroundTransparency = 1 image.Image = "rbxassetid://"..id image.Size = UDim2.new(1,0,1,0) game:GetService("Debris"):AddItem(gui,7) -- removes the Gui after 7 seconds, put just before the ends if you want it. track = #4################ In############################################## "r######################sound.Volume = 1 repeat wait() until sound.TimeLength >0 sound:Play() wait(8) -- how long you want it to play for i = 1, 100 do sound.Volume = 1-(i/100) wait() end sound:Destroy() end end end) - I put in all that, its in ServerScriptService in a normal script. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 08:23 PM |
Yeahhh you did not assemble my code fragments properly, lol Here it is,
id = 1234567 -- replace with your decal ID game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if player.Name == "IrishBannana" then if msg == "!victory" then for _,player in pairs(game.Players:GetPlayers()) do local gui = Instance.new("ScreenGui",player.PlayerGui) local frame = Instance.new("Frame",gui) frame.BackgroundTransparency = 1 frame.Size = UDim2.new(0,400,0,400) frame.Position = UDim2.new(.5,0,.5,0) local image = Instance.new("ImageLabel",frame) image.BackgroundTransparency = 1 image.Image = "rbxassetid://"..id image.Size = UDim2.new(1,0,1,0) game:GetService("Debris"):AddItem(gui,7) end track = 1234567 sound = Instance.new("Sound",workspace) sound.SoundId = "rbxassetId://"..track sound.Volume = 1 repeat wait() until sound.TimeLength >0 sound:Play() wait(10) -- how long you want it to play for i = 1, 100 do sound.Volume = 1-(i/100) wait() end sound:Destroy() end end)
|
|
|
| Report Abuse |
|
|
|
| 31 Oct 2016 08:30 PM |
| I put it together and did not modify it at all just so It would not mess up, it still wont work. I used "!Victory,!victory" and nothing looks wrong. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 31 Oct 2016 08:34 PM |
I mean, no, you didn't i.e. this segment
id = 300374048 -- replace with your decal ID game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if player.Name == "IrishBannana end" end" then if msg == "!victory" then
-- But the code I posted recently should work, as long as there are no goofy errors I made. Are there any specific errors that you're seeing in the output?
|
|
|
| Report Abuse |
|
|
mybowls72
|
  |
| Joined: 05 Aug 2013 |
| Total Posts: 2688 |
|
|
| 31 Oct 2016 08:38 PM |
(if player.Name == "IrishBannana end")
Lol'd .__ . |
|
|
| Report Abuse |
|
|
| |
|
|
| 31 Oct 2016 10:48 PM |
| I'm doing it right, it just doesn't work. |
|
|
| Report Abuse |
|
|
MiniNob
|
  |
| Joined: 14 May 2013 |
| Total Posts: 822 |
|
|
| 01 Nov 2016 04:34 AM |
| Maybe if you ask your computer nicely it will work |
|
|
| Report Abuse |
|
|
| |
|