Like maybe changing something from true to false inside one script with a script ?
Hey 1Messi3903,
---- Bindable Events ---- -- Script #1 -- local event = script.Parent:WaitForChild("Event") -- The variable for the Bindable Event. event:Fire("ChangeVariableToSomething") -- Using the BindableEvent's :Fire() function to send the string that the variable will be changed to. -- Script #2 -- local event = script.Parent:WaitForChild("Event") -- Variable for the event; local value; -- The value that will be changed. event.Event:Connect(function(val) -- Anonymous function connecting the BindableEvent's Event(which is triggered by :Fire()) to the function. value = val; -- Setting value to the string that is sent. ~ Doesn't have to be a string. It can be any value. print(value); -- Printing the value. end) -- end for the anonymous function. ---- Bindable Events ----
---- Bindable Functions ---- -- Script #1 -- local func = script.Parent:WaitForChild("Function"); -- Variable for the Function func:Invoke("ChangeItToThisString"); -- Invoking the function to make it change the value. -- Script #2 -- local func = script.Parent:WaitForChild("Function"); -- Variable for the function local value; -- Variable for the value, declared as nil atm. function change_value(val) -- Function that will change the value with the parameter of the value that it will be changed to. value = val; -- Setting value to the parameter. print(value); -- Printing value. end -- end for the function. func.OnInvoke = change_value; -- Detects when :Invoke() is fired on this Function, if it is fired then it connects it to this function called 'change_value' ---- BIndable Functions ----
~~ KingLoneCat
Well you can't have a script access another script because roblox stopped this method because of hackers hacking into the studio and stealing scripts
You could have an object and have another script change it
Here is script one:
local myInt = Instance.new("IntValue",game.Workspace) myInt.Name = "myInt" myInt.Value = 10 print(myInt)
Here is the second script:
local Int = game.Workspace.myInt Int.Value = 15 print(Int.Value)
You will see in the output that it will print diffrent things Well this is an example of changing an object value, name etc.