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: Whats wrong with this script

Previous Thread :: Next Thread 
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2016 10:21 AM
I want it that If you touch it you gain 10000 dollars. Cant figure what's wrong.


local Config = script.Parent.Configuration
local Gamepass = Config.GamepassId.Value
local Group = Config.GroupId.Value
local Kill = Config.KillOnTouch.Value

local Door = script.Parent.Door

Door.Transparency = 0
Door.CanCollide = true

function AllowedIn(Player)
if Player.userId == 0 then
return false
elseif Gamepass > 0 then
if game.MarketplaceService:PlayerOwnsAsset(Player,Gamepass) then
return true
end
elseif Group > 0 then
if Player:IsInGroup(Group) then
return true
end
end
return false
end

local Debounce = true


Door.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player and Debounce then
Debounce = false
if AllowedIn(Player) then
local bonus = game.ServerStorage.PlayerMoney:FindFirstChild(Player)
if bonus then
bonus.Value = 10000
end

else
if Gamepass > 0 then
game.MarketplaceService:PromptPurchase(Player,Gamepass)
end
if Kill then
hit.Parent.Humanoid.Health = 0
local Explosion = Instance.new("Explosion",workspace)
Explosion.BlastPressure = 0
Explosion.Position = hit.Position
else
if hit.Parent:FindFirstChild("Torso") then
hit.Parent.Torso.Velocity = Door.CFrame.lookVector * 0
end
end
end
wait(0.3)
Debounce = true
end
end
end)



Report Abuse
Notwal is not online. Notwal
Joined: 31 Dec 2014
Total Posts: 915
18 Jul 2016 11:22 AM
You see, the problem is, it can't just be 10 grand. It's gotta be a loan. And a small loan at that. But most importantly, it's gonna be 1 million.


Report Abuse
killerbot29003 is online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
18 Jul 2016 11:25 AM
keyword: gain


bonus.Value = bonus.Value + 10000


This siggy is copyrighted ©
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2016 12:14 PM
still not working :(



Report Abuse
brightstorm603 is not online. brightstorm603
Joined: 10 Apr 2010
Total Posts: 6807
18 Jul 2016 12:34 PM
Have you tried looking at the output window? It should tell you exactly what line of the script is broken.

http://wiki.roblox.com/index.php?title=Output
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2016 03:52 PM
I figured it out :) Thanks to everyone :D


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