So, I did some very simple coding to change the transparency and collision of an object. It’s all 100% correct, and as I actually know a decent amount of lua theres hardly any way I could mess the code up. For some reason, the script wont let me change it, no errors, nothing. I do it in command bar and console, it works perfectly. Any help would be appreciated.
Can we see the code/line of code you used just for reference?
You probably put a script or a local script in somehwere where it cannot run. If it’s a local script put it into startergui, and if it’s a server script put it in server script service.
Well its a module script as I’m putting it into the admin for the game. Its in server script service.
workspace.Flood.Water.Transparency = 0
workspace.Flood.Water.CanCollide = true
Then obviously the opposite for stopping it.
module scripts dont run unless you require it in another script.
Module scripts have to be required by either a Server or Local Script, in your case Server. So you should either do one of two things.
--- Server Script Only
workspace.Flood.Water.Transparency = 0
workspace.Flood.Water.CanCollide = true
-- and the opposites
--- Server and Module Script
-- First create a server and module script with the Server script as the module's parent
--Server
local module = require(script.ModuleScript)
module:Invisible()
wait(7)
module:Visible()
--Module Script
local module = {}
function module:Invisible()
workspace.Flood.Water.Transparency = 0
workspace.Flood.Water.CanCollide = true
end
function module:Visible()
workspace.Flood.Water.Transparency = 1
workspace.Flood.Water.CanCollide = false
end
return module
I know. I have got a server script that is firing the commands when needed.
I have done essentially that. Just obviously since I’ve got all the commands in the module script and theres args etc I’ve done it differently.
Can I see the server/module scripts or at least the parts handling this?
Well what I have done is taken the main module for adonis, added my command, published to roblox then changed the ID in the loader script. I have added prints to see if it is firing, and it is. Also all the other commands work
I’ve never used Adonis before so I’m unfamiliar with how it should end up looking command-wise. Try looking at other examples of adonis commands.
I literally copied and pasted a different command, and edited it to my needs. It is firing the event so I have done it correctly. Also I tried it with a click detector and a script earlier, didn’t work. Have a feeling its as I’m also trying to change some text in a text label (surface gui)
Try using print statements in different parts to see where the code goes wrong.
Ah. I forgot to make the if statement (as its a toggle) use a string to check what the player said.