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 » Game Design
Home Search
 

Re: Only allowing a certain person to ride a horse?

Previous Thread :: Next Thread 
somuchbetter is not online. somuchbetter
Joined: 20 Oct 2012
Total Posts: 273
29 Jun 2016 11:20 AM
I have some horses in my place, and I made one that has slightly different colors. I want that specific horse to kill anyone else if they try to sit on it, as it has a seat. I don't want it to kill on touch, because that would pose problems if I was riding by someone and they touched it. Only if they actually sit on it. I have an idea of how to do this, maybe the script would check the person sitting on it and if their name isn't "somuchbetter" it kills them.
Report Abuse
IRyan70 is not online. IRyan70
Joined: 08 Jun 2011
Total Posts: 484
29 Jun 2016 11:25 AM
You can do that, (checking name) , or just create a bool value like "Rider" and set it true or false in relation to if they can sit on the horse or not. Just have the seat ask for that variable value
Report Abuse
somuchbetter is not online. somuchbetter
Joined: 20 Oct 2012
Total Posts: 273
29 Jun 2016 11:26 AM
I will try this and see if it works-

local seat = script.Parent
seat.Changed:connect(function(property)
if property ~= 'Occupant' then return end

local occupant = seat.Occupant
if occupant then
local character = occupant.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player.Name ~= "somuchbetter" then
player.Character.Humanoid:TakeDamage(100)
end
end
end)
Report Abuse
somuchbetter is not online. somuchbetter
Joined: 20 Oct 2012
Total Posts: 273
29 Jun 2016 11:27 AM
I posted right when you posted, that could work too.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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