Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My script works in studio but not in game?

Asked by 8 years ago

``local Torso = game.Players.LocalPlayer.Character:WaitForChild("Torso")

local sound = Instance.new("Sound",Torso) sound.Volume=1 sound.Pitch=1 sound.Name="" sound.Looped=true sound.PlayOnRemove=false local player = game.Players.LocalPlayer local Format = "http://www.roblox.com/asset/?id=##ID##" local frame = script.Parent:WaitForChild("Frame")

frame:WaitForChild("Play").MouseButton1Click:connect(function() local input = tonumber(frame:WaitForChild("Input").Text) if input then sound:Stop() sound.SoundId=Format:gsub("##ID##", tostring(input)) sound:Play() end end) frame:WaitForChild("Stop").MouseButton1Click:connect(function() sound:Stop() end````

Why wont this work?

Answer this question