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
|
  |
| Joined: 15 Jun 2012 |
| Total Posts: 85 |
|
| |
|
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 |
|
|