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: attempt to index local "essence", a boolean value

Previous Thread :: Next Thread 
1snivy10 is not online. 1snivy10
Joined: 15 Jun 2012
Total Posts: 85
29 Aug 2017 01:25 PM
Yay another help request from me because none of my sources are helping or I'm still loopy from my surgery. Of all my requests this one will probably have the easiest fix. Note: using a modulescript instead of a boolvalue because it's more secure

FE is on

///modulescript:

local essenceget = {}

essenceget[1] = false

return essenceget

///script inside a part:

get = require(game.Workspace.modulescripts.essencetracker)

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') and hit.Parent:FindFirstChild('Humanoid').Health > 0 and get[1] == false then
print("essence touch") --this is printing
game.ReplicatedStorage.Remote.EssenceEvent:FireClient(script.Parent, get[1])
game.Players.LocalPlayer.leaderstats.Essence.Value = game.Players.LocalPlayer.leaderstats.Essence.Value + 1
wait()
end
end)

///localscript in starterplayerscripts:

game.ReplicatedStorage.Remote.EssenceEvent.OnClientEvent:Connect(function(essence, get) -- Triggered on event.
print("localscript fired") --this is printing
essence.Transparency = 0.1 --Players.1snivy10.PlayerScripts.Localscript:3:attempt to index local 'essence' (a boolean value). This is where I believe the source of this error is located.
essence.Material = "SmoothPlastic"
get = true
end)
Report Abuse
1snivy10 is not online. 1snivy10
Joined: 15 Jun 2012
Total Posts: 85
29 Aug 2017 01:56 PM
bump
Report Abuse
sonihi is not online. sonihi
Joined: 27 Jun 2009
Total Posts: 3655
29 Aug 2017 01:59 PM
okay so

game.ReplicatedStorage.Remote.EssenceEvent:FireClient(script.Parent, get[1])
game.Players.LocalPlayer.leaderstats.Essence.Value = game.Players.LocalPlayer.leaderstats.Essence.Value + 1

wouldn't work.

Why? When you do RemoteEvent:FireClient the first thing always has to be player, so
RemoteEvent:FireClient(Player,get[1]).

Also this is a server script and you can't use localplayer.

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