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
 

How do i start?

Previous Thread :: Next Thread 
DominatedLegacy is online. DominatedLegacy
Joined: 26 Aug 2011
Total Posts: 769
24 Mar 2017 05:37 PM
https://www.roblox.com/games/691640650/Beta-Eeny-Meeny-Miny-Moe

In this game the player clicks one of the four random parts and depending on a random chance 3 if them are incorrect and one of them are correct clicking a incorrect one will cause the Baseplate part to Cancollide off and the player will fall and die. Clicking a correct one will cause nothing to happen.

I am fairly new to scripting and i am still learning lua so my question is how would i go about creating the math.random script for my game?


-Dominatedlegacy

Update:
So i was told

local n = math.random(1,4)

if Part.Value ~= n then
Baseplate.CanCollide = false
end

Where would i put this code? Workspace?


-Dominatedlegacy
Sorry for duplicating this forum


-Dominatedlegacy
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
24 Mar 2017 05:51 PM
That's not going to do anything. You need to define Part and Baseplate, then I'd recommend ServerScriptService.
Report Abuse
COOKCASE22 is not online. COOKCASE22
Joined: 01 Sep 2013
Total Posts: 818
24 Mar 2017 06:18 PM
local value = math.random(1,4)
local baseplate = game.Workspace.Baseplate
local part = game.Workspace.Part

function onClicked(click)
if value ~= 1 then
baseplate.CanCollide = false
baseplate.Transparency = .5
wait(3)
baseplate.Cancollide = true
baseplate.Transparency = 0
script.Parent.ClickDetector.MouseClick:connect(onClicked)

this goes into the 4 random parts along with click detectors
please dont just copy and paste though, read it, learn from it
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