Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script working fine on Studio but not on Roblox Player. Is there any solution to this?

Asked by 1 year ago

I was making a script builder and when I used the execute button, it errored stating that P is not a valid member of the controller. In Studio, it works fine, but it makes errors on the Roblox Player. I used Studio's play mode, the script type is a local script, and the location is in a proper place (StarterGui).

What I expect is that the script executes just fine depending on the location (Client, server), but it actually errors stating that P is not a valid member of the controller in line 1 with the exception in Studio.

01local text = script.Parent.Parent.Content.ServerCode
02local ActiveSide = script.Parent.Parent.ActiveSide
03local Server = script.Parent.Parent.Server
04local Client = script.Parent.Parent.Client
05local RelplicatedStorage = game:GetService("ReplicatedStorage")
06local loadstringclient = require(RelplicatedStorage.Loadstring)
07 
08script.Parent.MouseButton1Click:Connect(function()
09    if ActiveSide.Value == Server then
10        game:GetService("ReplicatedStorage").ExecuteServer:FireServer(text.ContentText)
11    elseif ActiveSide.Value == Client then
12        loadstringclient(text.ContentText)()
13    end
14end)

Answer this question