Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 04 Apr 2016 02:47 PM |
This is part of a click button script I use -------------------------- debounce = script.Parent.Debounce buttons = script.Parent.Bricks local module = require(game.ServerScriptService.ButtonClicks) gui = game.ServerStorage.Guis.MaxClicked
for a, b in pairs(buttons:GetChildren()) do b.ClickDetector.MouseClick:connect(function(player) module.Clicked(player, gui) print ("Passed")
------------------- This is the module script's function im using
function func.Clicked(player, gui) local val = player.Character:FindFirstChild("MaxClick") if val then if val.Value ~= 0 then print("value is not 0") val.Value = val.Value -1 elseif val.Value == 0 then print("Value is 0") local g = gui:clone() g.Parent = player.PlayerGui else print("MaxClick not found") end end end
All it prints is ("Passed"). No error is thrown. Goes through as if there was no module function and Im running out of ideas
-Salinas con el número 23 |
|
|
| Report Abuse |
|
|
iara56
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 1032 |
|
|
| 04 Apr 2016 03:05 PM |
you can't acces server_script_service from the client
|
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 04 Apr 2016 03:20 PM |
bump of im clueless
-Salinas con el número 23 |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2016 03:29 PM |
If you told us the full scope of what you're trying to do and why for some reason you need to return the function from a module's function of it's own function (or something crazy like that I don't even remember) we could probably tell you the best way to do it.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 04 Apr 2016 03:43 PM |
--server script local module = require(game.ServerScriptService.ButtonClicks) local debounce = script.Parent.Debounce local buttons = script.Parent.Bricks local gui = game.ServerStorage.Guis.MaxClicked
for i, v in next, buttons:GetChildren() do v.ClickDetector.MouseClick:connect(function(player) module.Clicked(player,gui) end) end --module script local module = {}
module.Clicked = function(player, gui) local val = player.Character:FindFirstChild("MaxClick") if val then if val.Value ~= 0 then val.Value = val.Value - 1 else gui:Clone().Parent = player.PlayerGui end end end
return module
|
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 04 Apr 2016 04:36 PM |
those arent thewhole scripts
this is the whole module script
local func = {}
function func.Clicked(player, gui) local val = player.Character:FindFirstChild("MaxClick") if val then if val.Value ~= 0 then print("value is not 0") val.Value = val.Value -1 elseif val.Value == 0 then print("Value is 0") local g = gui:clone() g.Parent = player.PlayerGui else print("MaxClick not found") end end end
function func.CheckValue(plr, val) val = plr.Character:FindFirstChild("MaxClick") if val then return val.Value end end
return func
------- this is the whole button script
debounce = script.Parent.Debounce buttons = script.Parent.Bricks local module = require(game.ServerScriptService.ButtonClicks) gui = game.ServerStorage.Guis.MaxClicked
for a, b in pairs(buttons:GetChildren()) do b.ClickDetector.MouseClick:connect(function(player) module.Clicked(player, gui) print ("Passed") --local val = module.CheckValue(player) --if val.Value ~= 0 then if debounce.Value == false then debounce.Value = true for a, b in pairs (b.Parent:GetChildren()) do b.BrickColor = BrickColor.new("Black") end wait(3) for a, b in pairs (b.Parent:GetChildren()) do b.BrickColor = BrickColor.new("Bright red") end debounce.Value = false end -- else --end end) end
So no my problem is not the ends
-Salinas con el número 23 |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 04 Apr 2016 04:59 PM |
FIXED THIS
I was looking for child "MaxClick", actual name was "MaxClicks"
qqqqqqqqqq
-Salinas con el número 23 |
|
|
| Report Abuse |
|
|