generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Works in studio, not in game.

Previous Thread :: Next Thread 
Cartoonfive is not online. Cartoonfive
Joined: 02 Nov 2015
Total Posts: 2105
11 Mar 2016 05:17 PM
local data = game.Workspace.data
local mouse = game.Players.LocalPlayer:GetMouse()
player = script.Parent.Parent.Character:FindFirstChild("Humanoid")

cooldown = false

function vision()
if cooldown == false then
cooldown = true
script.activate:Play()
script.beat:Play()
script.Parent.pulse.Disabled = false
script.Parent.static.fuzz.ImageTransparency = 0
player.WalkSpeed = 20
wait(0.1)
game.Lighting.Ambient = Color3.new(1,1,1)
game.Lighting.Brightness = 5
wait(0.05)
game.Lighting.Ambient = Color3.new(0.8,1,0.8)
game.Lighting.Brightness = 4
wait(0.05)
game.Lighting.Ambient = Color3.new(0.6,1,0.6)
game.Lighting.Brightness = 3
wait(0.05)
game.Lighting.Ambient = Color3.new(0.4,1,0.4)
game.Lighting.Brightness = 2
wait(0.05)
game.Lighting.Ambient = Color3.new(0.2,1,0.2)
game.Lighting.Brightness = 1
wait(0.05)
game.Lighting.Ambient = Color3.new(0,1,0)
game.Lighting.Brightness = 0
data.infinite.Value = true
data.visionuses.Value = data.visionuses.Value + 1
wait(10)
script.beat:Stop()
game.Lighting.Ambient = Color3.new(0,0,0)
data.infinite.Value = false
script.Parent.pulse.Disabled = true
player.WalkSpeed = 16
script.Parent.static.fuzz.ImageTransparency = 0.7
wait(5)
cooldown = false
end


end
mouse.KeyDown:connect(function(pressed)
pressed = pressed:lower()
if pressed == "n" then
vision()
end
end)



When i actually play the game from the website nothing happens when i press n, and i cant see whats wrong. In studio it works and doesnt print any errors.
Report Abuse
Cartoonfive is not online. Cartoonfive
Joined: 02 Nov 2015
Total Posts: 2105
11 Mar 2016 05:28 PM
bump
Report Abuse
skrecher23456 is not online. skrecher23456
Joined: 14 Apr 2012
Total Posts: 986
11 Mar 2016 05:38 PM
rip
Report Abuse
Cartoonfive is not online. Cartoonfive
Joined: 02 Nov 2015
Total Posts: 2105
11 Mar 2016 05:43 PM
i just want to know why nothing is happening
Report Abuse
Cartoonfive is not online. Cartoonfive
Joined: 02 Nov 2015
Total Posts: 2105
11 Mar 2016 06:40 PM
bump
Report Abuse
AviatorEU is not online. AviatorEU
Joined: 27 Dec 2015
Total Posts: 62
11 Mar 2016 07:18 PM
I think it's because a lightingvalue can't be changed from startergui or the client.


try this

--script in workspace
local event = Instance.new("RemoteFunction",game.Workspace)
event.Name = "CreationOfWhatever"
function event.OnServerInvoke()
if cooldown == false then
cooldown = true
script.activate:Play()
script.beat:Play()
script.Parent.pulse.Disabled = false
script.Parent.static.fuzz.ImageTransparency = 0
player.WalkSpeed = 20
wait(0.1)
game.Lighting.Ambient = Color3.new(1,1,1)
game.Lighting.Brightness = 5
wait(0.05)
game.Lighting.Ambient = Color3.new(0.8,1,0.8)
game.Lighting.Brightness = 4
wait(0.05)
game.Lighting.Ambient = Color3.new(0.6,1,0.6)
game.Lighting.Brightness = 3
wait(0.05)
game.Lighting.Ambient = Color3.new(0.4,1,0.4)
game.Lighting.Brightness = 2
wait(0.05)
game.Lighting.Ambient = Color3.new(0.2,1,0.2)
game.Lighting.Brightness = 1
wait(0.05)
game.Lighting.Ambient = Color3.new(0,1,0)
game.Lighting.Brightness = 0
data.infinite.Value = true
data.visionuses.Value = data.visionuses.Value + 1
wait(10)
script.beat:Stop()
game.Lighting.Ambient = Color3.new(0,0,0)
data.infinite.Value = false
script.Parent.pulse.Disabled = true
player.WalkSpeed = 16
script.Parent.static.fuzz.ImageTransparency = 0.7
wait(5)
cooldown = false
end

--in the gui

local data = game.Workspace.data
local mouse = game.Players.LocalPlayer:GetMouse()
player = script.Parent.Parent.Character:FindFirstChild("Humanoid")
local event = game.Worksapce:WaitForChild"CreationOfWhatever"

cooldown = false

function event()
event:InvokeServer()
end

end
mouse.KeyDown:connect(function(pressed)
pressed = pressed:lower()
if pressed == "n" then
event()
end
end)


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Mar 2016 08:02 PM
You need to wait for the Character to load. Check the output dude.


Report Abuse
Cartoonfive is not online. Cartoonfive
Joined: 02 Nov 2015
Total Posts: 2105
11 Mar 2016 09:26 PM
Jared, i press the key like 20 seconds after the game has loaded and nothing happens. And i already said, im trying this in game from the website, im not testing in studio. Please read the thread.

And the person who posted a different version, it did not work, but thanks for the help. >.> Ive made other scripts just like this one and theyve worked fine. IDK what the problem is.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image